home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / terminal / kermit188.lha / kermit / kermit.doc < prev    next >
Encoding:
Text File  |  1992-11-02  |  192.1 KB  |  4,565 lines

  1.  
  2.                               C-KERMIT USER GUIDE
  3.  
  4.  
  5.               FOR UNIX, VAX/VMS, AND SOME OTHER OPERATING SYSTEMS
  6.  
  7.  
  8.                                 Version 5A(178)
  9.  
  10.  
  11.                     Christine M. Gianone and Frank da Cruz
  12.  
  13.               Columbia University Center for Computing Activities
  14.                              612 West 115th Street
  15.                             New York, NY 10025 USA
  16.  
  17.  
  18.  
  19.                                    D*R*A*F*T
  20.  
  21.                                 29 January 1992
  22.  
  23.                            Copyright (C) 1985, 1992
  24.             Trustees of Columbia University in the City of New York
  25.  
  26.      Permission is granted to any individual or institution to use, copy,
  27.     or redistribute this document so long as it is not sold for profit, and
  28.                   provided this copyright notice is retained.
  29.  
  30.  
  31. 1. C-Kermit
  32.  
  33. ********
  34. This document is formatted as an ordinary, plain text ASCII disk file.  Typeset
  35. copies are available in the Kermit User Guide from Columbia University.
  36. Changes should be made to CKUKER.MSS.
  37. ********
  38.  
  39. Program:        Frank da Cruz (Columbia University), contributions by many
  40.                 others.
  41. Language:       C
  42. Documentation:  Christine Gianone, Frank da Cruz (Columbia University).
  43. Version:        5A(178)
  44. Date:           January 1992
  45.  
  46.  
  47. UNIX Kermit Capabilities At A Glance:
  48.  
  49.   Local operation:                   Yes
  50.   Remote operation:                  Yes
  51.   Transfer text files:               Yes
  52.   Transfer binary files:             Yes
  53.   International text:                Yes
  54.   Wildcard send:                     Yes
  55.   File transfer interruption:        Yes
  56.   Filename collision actions:        Yes
  57.   Can time out:                      Yes
  58.   8th-bit prefixing:                 Yes
  59.   Repeat count prefixing:            Yes
  60.   Alternate block checks:            Yes
  61.   Automatic parity detection:        Yes
  62.   Dynamic packet length:             Yes
  63.   CONNECT mode:                      Yes
  64.   Terminal emulation:                Depends on implementation
  65.   Communication settings:            Yes
  66.   Transmit BREAK:                    Yes (most versions)
  67.   Support for dialout modems:        Yes
  68.   TCP/IP support:                    Yes (Berkeley sockets)
  69.   X.25 support:                      Yes (SUN versions with SunLink)
  70.   IBM mainframe communication:       Yes
  71.   Transaction logging:               Yes
  72.   Session logging:                   Yes
  73.   Debug logging:                     Yes
  74.   Packet logging:                    Yes
  75.   Act as server:                     Yes
  76.   Talk to server:                    Yes
  77.   Advanced server functions:         Yes
  78.   Security for server:               Yes
  79.   Local file management:             Yes
  80.   Command/Init files:                Yes
  81.   Long packets:                      Yes
  82.   Sliding Windows:                   Yes
  83.   File attributes packets:           Yes
  84.   Command macros:                    Yes
  85.   Script programming language:       Yes
  86.   Raw file transmit and capture:     Yes
  87.  
  88.  
  89. 1.1. Acknowledgements
  90.  
  91. Thanks to the dozens of people who have been involved in C-Kermit development
  92. over the years, especially Bill Catchings and Jeff Damens (formerly of Columbia
  93. University), Chris Maio (still of Columbia University), and Herm Fischer of
  94. Encino, CA, for their roles in its initial development.  And special thanks to
  95. those who put so much work into features or testing of version 5A:
  96.  
  97.     Kristoffer Eriksson (Peridot Konsult AB, Orebro, Sweden)
  98.     Bo Kullmar (Sveriges Riksbank (Central Bank of Sweden), Stockholm)
  99.     Tor Lillqvist (Helsinki University, Finland)
  100.     Warren H. Tucker (Tridom Corporation, Mountain Park, Georgia, USA)
  101.     Peter Mauzey (AT&T Bell Laboratories, Middletown, New Jersey, USA)
  102.     Terry Kennedy (St Peters College, Jersey City, NJ, USA)
  103.     Chuck Hedrick (Rutgers University, New Brunswick, NJ, USA)
  104.     Joe R. Doupnik (Utah State University, USA)
  105.     Ken Yap (University of Rochester, New York, USA)
  106.     Marcello Frutig (Catholic University, Rio de Janeiro, Brazil)
  107.     Paul Placeway (BBN, Cambridge, Massachusetts, USA)
  108.     Chris Adie (Edinburgh University, Scotland, UK)
  109.     Chris Armstrong (Brookhaven National Laboratory, New York, USA)
  110.     Mark Buda (Digital Equipment Corporation, New Hampshire, USA)
  111.     William Bader (Software Consulting Services, Nazareth, PA, USA)
  112.     Steve Walton (California State University Northridge, USA)
  113.  
  114. Kristoffer, Bo, Warren, and Peter comprised the "modem committee", which worked
  115. long and hard to rationalize C-Kermit's treatment of modem signals in the many
  116. and varied Unix environments.  Kristoffer and Bo also contributed much code to
  117. the Unix-specific support modules.  Kristoffer deserves a special Archaeology
  118. Achievement Award for a detailed study and unraveling of many years' accretions
  119. of incomprehensible "magic" in the infamous ckutio.c module (a collection of
  120. supposedly simple functions that give the emphatic lie to all claims that Unix
  121. is a "portable operating system").
  122.  
  123. Ken got the TCP/IP support started by supplying the sockets code for the
  124. Berkeley UNIX version.  Marcello supplied the SunLink X.25 code.  Paul, as
  125. always in recent years, is responsible for the Macintosh end, the two Chris's
  126. for the OS/2 version, Terry, William, Mark for the VAX/VMS version, and Steve
  127. for the Amiga version.
  128.  
  129. Chuck found and fixed many bugs and contributed many valuable insights, as well
  130. as writing the Unix "man page" for C-Kermit 5A.
  131.  
  132. And thanks to the indefatigable and omniscient Joe Doupnik (author of MS-DOS
  133. Kermit), who worked closely with the authors on the design of the sliding
  134. window algorithms, the script programming language, and the international
  135. character set support during the joint development effort for MS-DOS Kermit 3.0
  136. and C-Kermit 5A (and in his spare time, Joe lent a hand with the AT&T 7300 Unix
  137. PC version of C-Kermit).  And finally, thanks to the dozens (hundreds) of
  138. others who tested C-Kermit on dozens (hundreds) of hardware and software
  139. platforms and contributed bug reports, fixes, new features, and suggestions:
  140. Hirofumi Fujii, Jay Rouman, Andy Fyfe, David MacKenzie, John Chmielewski, Frank
  141. Prindle, Dean Long, David A Rasmussen, Ted Medin, Farrell Woods, John Dunlap,
  142. Larry Rosenman, Roger Wallace, Jack Bryans, Drew Burton, Daniel Senderowicz,
  143. Rich Auletta, Tye McQueen, Evan R Moore, Christian Hemsing, Jeff Altman, Irwin
  144. Sobel, Mike Beede, Charlie Epstein, Bob Devonshire, Jim Barbour, Berthold K.P.
  145. Horn, Allister J. Gorman, Dave Bruce, Rick Troth, Caleb Strockbine, Charles
  146. S. Fuller, Andy Y.A. Kuo, Peter Jones, Lars Kellogg-Stedman, Patrick Wolfe,
  147. Dennis Pleticha, John Kesich, Erik Olsen, Mark Zinzow, Tom Wade, Wally
  148. Strzelec, Lawrence R. Rogers, Nick Sayer, Piet W Plomp, Manfred Prange, Gary J
  149. Rosenblum, Ethan A Lish, Bert Laverman, John Nall, Didier Marion, Nate
  150. Williams, Bob Perkins, Brad Robillard, Fred van Kempen, J Roberts, David Dyck,
  151. G Brendan Reilly, Matt Sutter, Sergey Kartashoff, Michael Yaroslavtsev, and
  152. Konstantin Vinogradov.
  153.  
  154.  
  155. 1.2. Introduction
  156.  
  157. C-Kermit is a communication software program written in C that provides a full
  158. implementation of the Kermit file transfer protocol, plus terminal connection,
  159. modem dialing, file management, and a powerful script programming language.  An
  160. important goal of C-Kermit is transportability to different computers and
  161. operating systems.  To date, C-Kermit (one release or another) has been adapted
  162. to UNIX (most versions), VAX/VMS, Data General AOS/VS, IBM OS/2, the Apple
  163. Macintosh, the Commodore Amiga, the Atari ST, Apollo Aegis, OS-9, Microsoft
  164. Windows, NCR 9800/VE, and others.
  165.  
  166. C-Kermit offers you several methods of interaction.  On UNIX, VAX/VMS, and
  167. other timesharing systems, you have access to Kermit's interactive command
  168. parser, and you can also invoke Kermit with command line options.  On
  169. workstations like the Macintosh, and to some degree the PS/2 with OS/2, there
  170. is a mouse-and-window interface with pull-down menus, radio buttons, and so
  171. forth; these are (or will be) described in separate documents.
  172.  
  173. Interactive operation gives you full access to all of C-Kermit's features.
  174. Command-line invocation gives you access to a small but useful subset.
  175. Command-line operation is described in Section 1.14.
  176.  
  177.  
  178. 1.3. Interactive Operation
  179.  
  180. C-Kermit's interactive command prompt is "C-Kermit>".  In response to this
  181. prompt, you can type any valid interactive C-Kermit command.  C-Kermit executes
  182. the command and then prompts you for another command.  The process continues
  183. until you instruct the program to terminate.
  184.  
  185. Commands begin with a keyword, normally an English verb, such as "send".  You
  186. may omit trailing characters from any keyword, as long as you specify
  187. sufficient characters to distinguish it from any other keyword valid in that
  188. field.  Certain commonly-used keywords (such as "send", "receive", "connect")
  189. also have special non-unique abbreviations ("s" for "send", "r" for "receive",
  190. "c" for "connect").
  191.  
  192. Command keywords can be entered in either upper or lower case, or any
  193. combination.  This manual shows command keywords in uppercase for clarity.
  194.  
  195. Certain characters have special functions while you are typing interactive
  196. commands:
  197.  
  198.     ?   Question mark, typed at any point in a command, will produce a message
  199.         explaining what is possible or expected at that point.  Depending on
  200.         the context, the message may be a brief phrase, a menu of keywords, or
  201.         a list of files.  Use "?" liberally to feel your way through Kermit's
  202.         commands.
  203.  
  204.     ESC (The Escape or Altmode key) -- Request completion of the current
  205.         keyword or filename, or insertion of a default value.  The result will
  206.         be a beep if the requested operation fails.
  207.  
  208.     TAB (The horizontal Tab key) -- Same as ESC.
  209.  
  210.     DEL (The Delete or Rubout key) -- Delete the previous character from the
  211.         command.  You may also use BS (Backspace, Control-H) for this function.
  212.  
  213.     ^W  (Control-W) -- Erase the rightmost word from the command line.
  214.  
  215.     ^U  (Control-U) -- Erase the entire command.
  216.  
  217.     ^R  (Control-R) -- Redisplay the current command.
  218.  
  219.     ^C  (Control-C) -- Interrupt a command.
  220.  
  221.     SP  (Space) -- Delimits fields (keywords, filenames, numbers) within a
  222.         command.
  223.  
  224.     CR  (Carriage Return) -- Enters the command for execution.  LF (Linefeed)
  225.         or FF (formfeed) may also be used for this purpose.
  226.  
  227.     \   (Backslash) -- Enter any of the above characters into the command
  228.         literally.  To enter a backslash, type two backslashes in a row (\\).
  229.         A backslash at the end of a command line causes the next line to be
  230.         treated as a continuation line; this is useful for readability in
  231.         command files.  Backslash is also used to introduce special characters,
  232.         variable names, and functions.  These are explained in Section 1.11.
  233.  
  234.     ^Z  (Control-Z) -- On systems (like Berkeley Unix, Ultrix) with job
  235.         control, Control-Z is supposed to suspend Kermit, i.e. put it into the
  236.         background in such a way that it can be brought back into the
  237.         foreground (e.g. with an 'fg' shell command) with all its settings
  238.         intact.
  239.  
  240. You may type the editing characters (DEL, ^W, etc) repeatedly, to delete all
  241. the way back to the prompt.  No action will be performed until the command is
  242. entered by typing carriage return, linefeed, or formfeed.  If you make any
  243. mistakes, you will receive an informative error message and a new prompt --
  244. make liberal use of `?' and ESC to feel your way through the commands.  One
  245. important command is "help" -- you should use it the first time you run
  246. C-Kermit.
  247.  
  248. Comments may be entered as entire commands, or may appear at the end of any
  249. command.  Comments are introduced by semicolon (;) or pound sign (#).
  250.  
  251. Interactive C-Kermit accepts commands from files as well as from the keyboard.
  252. When you start C-Kermit, the program looks for a special file, the Kermit
  253. Initialization File in your home or current directory (first it looks in the
  254. home directory, then in the current one) and executes any commands it finds
  255. there.  These commands must be in interactive format, not command-line format.
  256. The name of the initialization file is .kermrc in UNIX and CKERMIT.INI in other
  257. operating systems.
  258.  
  259. Here is a brief list of C-Kermit interactive commands:
  260.               ;  Introduce a full-line or trailing comment (also #).
  261.               !  Execute a system command or enter system command interpreter.
  262.               @  Same as !.
  263.             ASK  Prompt the user, store user's reply in a variable.
  264.            ASKQ  Like ASK, but, but doesn't echo (useful for passwords).
  265.          ASSIGN  Assign an evaluated string to a variable or macro.
  266.             BUG  Instructions for reporting bugs.
  267.             BYE  Terminate and log out a remote Kermit server.
  268.              CD  Change Working Directory (also, CWD).
  269.           CLEAR  Clear communication device input buffer.
  270.           CLOSE  Close a log or other local file.
  271.         COMMENT  Introduce a full-line comment.
  272.         CONNECT  Establish a terminal connection to a remote computer.
  273.         DECLARE  Declare an array.
  274.       DECREMENT  Subtract one (or other number) from a variable.
  275.          DEFINE  Define a variable or macro.
  276.          DELETE  Delete a file or files.
  277.            DIAL  Dial a telephone number.
  278.       DIRECTORY  Display a directory listing.
  279.         DISABLE  Disallow access to selected features during server operation.
  280.              DO  Execute a macro.
  281.            ECHO  Display text on the screen.
  282.            ELSE  ELSE-part of an IF command.
  283.          ENABLE  Allow access to selected features during server operation.
  284.             END  A command file or macro.
  285.            EXIT  Exit from the program, closing all open files and devices.
  286.          FINISH  Instruct a remote Kermit server to exit, but not log out.
  287.             FOR  Execute commands repeatedly in a counted loop.
  288.             GET  Get files from a remote Kermit server.
  289.            GOTO  Go to a labeled command in a command file or macro.
  290.          HANGUP  Hang up the phone or network connection.
  291.            HELP  Display a help message for a given command.
  292.              IF  Conditionally execute the following command.
  293.       INCREMENT  Add one (or other number) to a variable.
  294.           INPUT  Match characters from another computer against a given text.
  295.             LOG  Open a log file -- debugging, packet, session, transaction.
  296.            MAIL  Send a file as electronic mail to a specified address.
  297.           MSEND  Multiple SEND -- send a list of files.
  298.            OPEN  Open a local file for reading or writing.
  299.          OUTPUT  Send text to another computer.
  300.             PAD  (X.25 version only) Give X.25 PAD commands.
  301.           PAUSE  Do nothing for a given number of seconds.
  302.           PRINT  Print a local file on a local printer.
  303.            PUSH  Invoke host system interactive command interpreter.
  304.             PWD  Display current working device/directory.
  305.            QUIT  Same as EXIT.
  306.            READ  Read a line from a local file.
  307.         RECEIVE  Passively wait for files to arrive.
  308.          REDIAL  Redial the most recently dialed phone number.
  309.         REINPUT  Reexamine text previously received from another computer.
  310.          REMOTE  Issue file management commands to a remote Kermit server.
  311.          RENAME  Change the name of a file.
  312.          RETURN  Return from a user-defined function.
  313.             RUN  Run a program or system command.
  314.          SCRIPT  Execute a UUCP-style login script.
  315.            SEND  Send files.
  316.          SERVER  Begin server operation.
  317.             SET  Set various parameters.
  318.            SHOW  Display values of SET parameters.
  319.           SPACE  Display current disk space usage.
  320.      STATISTICS  Display statistics about most recent transaction.
  321.            STOP  Stop executing macro or command file and return to the prompt.
  322.         SUSPEND  Put the Kermit program in the backgound.
  323.            TAKE  Execute commands from a file.
  324.          TELNET  Start a TCP/IP TELNET session.
  325.        TRANLATE  Translate a file's character set.
  326.        TRANSMIT  Upload a file with no error checking.
  327.            TYPE  Display a file on the screen.
  328.         VERSION  Display the program version number on the screen.
  329.            WAIT  Wait for the specified modem signals.
  330.           WHILE  Execute commands repeatedly while a condition is true.
  331.           WRITE  Write text to a local file.
  332.             XIF  Extended IF command.
  333.  
  334. On most computers, C-Kermit can be started simply by typing the word "kermit"
  335. (followed by carriage return).  If no command-line options are included, Kermit
  336. will automatically enter interactive prompting mode.  Let's begin by looking at
  337. a few of C-Kermit's basic interactive commands.  Most important of all when
  338. your are just beginning are the commands to exit from the program and to get
  339. help about it.
  340.  
  341.  
  342. The EXIT and QUIT Commands
  343.  
  344. Syntax: EXIT [ number ] Syntax: QUIT [ number ]
  345.  
  346. These two commands are identical.  Both of them do the following:
  347.  
  348.    - Hangs up the modem, if the communications line supports data terminal
  349.      ready.
  350.    - Relinquish access to any communication line assigned via SET LINE, or
  351.      any network connection obtained via SET HOST.
  352.    - Relinquish any uucp and multiuser locks on the communications line
  353.      (Unix only).
  354.    - Closes all open logs or other files.
  355.    - Attempts to insure that the terminal is returned to normal.
  356.  
  357. After exit from C-Kermit, your default directory will be the same as when you
  358. started the program.  The EXIT command is issued implicitly whenever C-Kermit
  359. halts normally, e.g. after a command line invocation, or after certain kinds of
  360. interruptions.
  361.  
  362. C-Kermit returns an exit status of zero, except when an error is encountered,
  363. where the exit status is set to a nonzero number, depending on the operating
  364. system.  In UNIX, the exit status is the sum of 1 (if any SEND commands
  365. failed), 2 (if any RECEIVE or GET commands failed), and 4 (if any REMOTE
  366. commands failed).  If you give a number after the EXIT or QUIT command, that
  367. number is returned instead.
  368.  
  369.  
  370. The HELP Command
  371.  
  372. Syntax: HELP [ { command, { SET, REMOTE } parameter } ]
  373.  
  374. Brief help messages or menus are always available at interactive command level
  375. by typing a question mark at any point.  A slightly more verbose form of help
  376. is available through the HELP command.  The HELP command with no arguments
  377. prints a brief summary of how to enter commands and how to get further help.
  378. HELP may be followed by one of the top-level C-Kermit command keywords, such as
  379. SEND, to request information about a command.  Commands such as SET and REMOTE
  380. have a further level of help.  Thus you may type HELP, HELP SET, or HELP SET
  381. PARITY; each will provide a successively more detailed level of help.
  382.  
  383.  
  384. The TAKE Command
  385.  
  386. Syntax: TAKE fn1
  387.  
  388. The TAKE command instructs C-Kermit to execute commands from the named file.
  389. The file may contain any interactive C-Kermit commands, including TAKE; command
  390. files may be nested to any reasonable depth, but it may not contain text to be
  391. sent to a remote system during the CONNECT command; Use scripts for that (see
  392. sections 1.12 and 1.13).
  393.  
  394. Echoing of commands from TAKE files and handling of errors during TAKE file
  395. execution are controlled by the SET TAKE command.
  396.  
  397. Comments may be included in take-command files.  Whole-line comments may begin
  398. with the word COMMENT.  Both trailing and whole-line comments can be introduced
  399. using semicolon or pound sign, for example:
  400.  
  401.     COMMENT - Commands to dial out out using a Hayes modem...
  402.     set modem hayes        ; Specify the kind of modem
  403.     set line /dev/ttyh8    ; Select a terminal device
  404.     set speed 19200        ; Set the speed
  405.     dial 7654321           ; Dial the number
  406.  
  407. TAKE-command files are in exactly the same syntax as interactive commands.  If
  408. you want to include special characters like question mark or backslash that you
  409. would have to quote with backslash when typing interactive commands, you must
  410. quote these characters the same way in command files.  Long lines may be
  411. continued by ending them with a single backslash or a dash:
  412.  
  413.     set\
  414.     modem\
  415.     hayes
  416.     set-
  417.     line /dev-
  418.     /ttyh8
  419.  
  420. Continued lines cannot have trailing comments.  If you put a trailing comment
  421. after the dash, then Kermit will not treat the line as continued.  If you put a
  422. dash at the end of a trailing comment, then Kermit will treat the next line as
  423. a continuation of the comment.
  424.  
  425. An implicit TAKE command is executed upon your C-Kermit initialization file
  426. (.kermrc in UNIX, CKERMIT.INI elsewhere) when C-Kermit starts up, upon either
  427. interactive or command-line invocation.  The initialization file may contain
  428. SET or other commands you want to be in effect at all times.  For instance, you
  429. might want override the default action when incoming files have the same names
  430. as existing files -- in that case, put a command like:
  431.  
  432.     set file collision overwrite
  433.  
  434. Under Unix, you may also use the shell's redirection mechanism to cause
  435. C-Kermit to execute commands from a file:
  436.  
  437.     kermit < cmdfile
  438.  
  439. or you can even pipe commands in from another process:
  440.  
  441.     command | kermit
  442.  
  443.  
  444. 1.4. Establishing the Connection
  445.  
  446. In order to talk about a connection between two computers, we a way to
  447. distinguish between them.  The local computer is the one that you are using
  448. most directly -- a PC or workstation on your desk, or a timesharing computer
  449. that you are using from a terminal.  Kermit lets you make a connection from the
  450. local computer to a remote computer, for example by dialing it up with a modem.
  451. The Kermit program on your local computer is said to be in "local mode" and the
  452. Kermit program on the remote computer is in "remote mode".
  453.  
  454. C-Kermit can be used in either remote or local mode.  If you are using C-Kermit
  455. in remote mode, you can skip ahead to Section 1.5, File Transfer.
  456.  
  457. If you are using C-Kermit in local mode, you must have one of three kinds of
  458. connections to the remote computer:
  459.  
  460.    1. A hardwired asynchronous serial connection, either directly to the
  461.       other computer, or through some kind of terminal server or switching
  462.       device.
  463.  
  464.    2. A dialup connection, which you establish by dialing with a modem.
  465.  
  466.    3. A network connection.
  467.  
  468. To prepare C-Kermit for these connections, several preliminary steps are
  469. necessary using the SET command, which is described in Section 1.10, below:
  470.  
  471.    1. Direct connection: SET LINE device-name, SET SPEED bits-per-second.
  472.  
  473.    2. Dialup connection, which you establish by dialing with a modem: SET
  474.       MODEM modem-type, SET LINE device-name, SET SPEED bits-per-second,
  475.       DIAL phone-number.
  476.  
  477.    3. Network connection: SET HOST network-host-name.  If your version of
  478.       C-Kermit supports more than one type of network, give the
  479.       appropriate SET NETWORK command before the SET HOST command (the
  480.       default network type is TCP/IP).  (Also see the TELNET command,
  481.       described below.)
  482.  
  483. In addition, you must establish whatever other communication related settings
  484. are appropriate for the connection, including PARITY, DUPLEX, FLOW, and
  485. HANDSHAKE.  Having done all this, you can use the CONNECT command to begin a
  486. terminal session with the remote computer, and once connected, you can initiate
  487. file transfers.
  488. The SET LINE Command
  489.  
  490. Syntax: SET LINE [ device ]
  491.  
  492. Close any previously open network, terminal, or modem connection.  If a device
  493. name is given, try to open the device for communication.  If no device name is
  494. given, revert to the default mode of communication (normally remote mode).
  495.  
  496.  
  497. The SET HOST Command
  498.  
  499. Syntax: SET HOST [ host [ service ] ]
  500.  
  501. Close any previously open network, terminal, or modem connection.  If the
  502. current network type (see SET NETWORK) is TCP/IP, the host field can be
  503. specified as an IP host name or a numeric IP host address, followed optionally
  504. by a TCP service name or port number (the default service is TELNET, TCP port
  505. number 23).  If the network type is X.25, the host field is an X.121 address,
  506. and there is no service field.  If no host name is given, revert to the default
  507. mode of communication (normally remote mode).
  508.  
  509.  
  510. The CONNECT Command
  511.  
  512. The CONNECT command (C is a special abbreviation for CONNECT) links your
  513. terminal to another computer as if it were a local terminal to that computer,
  514. through the device specified in the most recent SET LINE or SET HOST command,
  515. or through the default device if your system is a PC or workstation.  All
  516. characters you type at your keyboard are sent out the communication line (and
  517. if you have SET DUPLEX HALF, also displayed on your screen), and all characters
  518. arriving at the communication port are displayed on the screen.  Current
  519. settings of speed, parity, duplex, and flow-control are honored, and the data
  520. connection is 7 bits wide unless you have given the command SET TERMINAL
  521. BYTESIZE 8.  If you have issued a LOG SESSION command, everything you see on
  522. your screen will also be recorded to your session log.  This provides a way to
  523. "capture" files from remote systems that don't have Kermit programs available.
  524.  
  525. To get back to your own system, you must type the "escape character", which is
  526. Control-Backslash (^\) unless you have changed it with the SET ESCAPE command,
  527. followed by a single-character command, such as C for "close connection".
  528. Single-character commands may be entered in upper or lower case.  They include:
  529.  
  530.   C     Return to C-Kermit.  If you gave an interactive CONNECT command, return
  531.         to the C-Kermit prompt.  If you gave a -c or -n option on the command
  532.         line, close the connection and return to the system prompt.
  533.   B     Send a BREAK signal (about 0.275 sec).
  534.   L     Send a Long BREAK signal (about 1.5 sec).
  535.   0     (zero) send a null.
  536.   S     Give a status report about the connection.
  537.   H     Hangup the phone.
  538.   !     Escape to the system command processor "under" Kermit.  Exit or logout
  539.         to return to your CONNECT session.
  540.   Z     Suspend Kermit (UNIX only).
  541.   \nnn  A character in backslash-code form.
  542.   ^\    Send Control-Backslash itself (whatever you have defined the escape
  543.         character to be, typed twice in a row sends one copy of it).
  544.  
  545. Uppercase and control equivalents for (most of) these letters are also
  546. accepted.  A space typed after the escape character is ignored.  Any other
  547. character will produce a beep.
  548.  
  549. The connect command simply displays incoming characters on the screen.  It is
  550. assumed any screen control sequences sent by the host will be handled by the
  551. firmware or emulation software in your terminal or PC(Several C-Kermit
  552. implementations include terminal emulators, notably Macintosh and OS/2).
  553.  
  554. It is sometimes useful to see exactly what characters the host is transmitting,
  555. rather than having your terminal or emulator interpret them for you.  If you
  556. give the command SET DEBUG SESSION, then during CONNECT, C-Kermit will display
  557. control characters using "uparrow" notation, for example ^A for Control-A, ^B
  558. for Control-B, etc, ^[ for ESC.  8-bit characters are preceded by a tilde (~)
  559. character.
  560.  
  561.  
  562. The DIAL and REDIAL Commands
  563.  
  564. Syntax: DIAL telephone-number
  565. Syntax: REDIAL
  566.  
  567. The DIAL command controls dialout modems; you should have already issued a SET
  568. MODEM command to identify the type of modem to be used for dialing, and then
  569. SET LINE and SET SPEED commands to identify the terminal device to which the
  570. modem is connected, plus any desired SET CARRIER and SET DIAL commands to
  571. modify the behavior of the DIAL command itself.
  572.  
  573. In the DIAL command, you supply the phone number and the Kermit program feeds
  574. it to the modem in the appropriate format and then interprets dialer return
  575. codes and modem signals to inform you whether the call was completed.  These
  576. actions are based upon built-in knowledge of the control sequences and
  577. responses of each make and model of modem that C-Kermit knows about.
  578.  
  579. The telephone-number may contain imbedded modem-dialer commands appropriate to
  580. the selected modem type, such as comma for Hayes pause, or `&' for Ventel
  581. dialtone-wait and `%' for Ventel pause (consult your modem manual for details).
  582.  
  583. The REDIAL command is exactly like the DIAL command, except it uses the phone
  584. number you specified in your most recent DIAL command.
  585.  
  586. At the time of this writing, support is included for the following modems:
  587.  
  588.    - AT&T 7300 Internal Modem
  589.    - AT&T 2212C, 2224B, 2224CEO, and 2296A switched network modems in AT&T
  590.      mode
  591.    - AT&T Digital Terminal Data Module (DTDM)
  592.    - Cermetek Info-Mate 212A
  593.    - Concord Condor CDS 220
  594.    - Courier HST
  595.    - DEC DF03-AC
  596.    - DEC DF100 Series
  597.    - DEC DF200 Series
  598.    - General DataComm 212A/ED
  599.    - Hayes Smartmodem and compatibles
  600.    - IBM/Siemens/Rolm 9751 CBX DCM
  601.    - Microcom AX-9624
  602.    - Penril
  603.    - Racal Vadic
  604.    - Telebit Trailblazer, T1000, T1600, T2500
  605.    - US Robotics 212A
  606.    - Ventel
  607.  
  608. Support for new modems is added to the program from time to time; you can check
  609. the current list by typing SET MODEM ?.
  610.  
  611. There are also two "generic" modem types -- DIRECT (i.e. no modem at all, so
  612. that no attempt is made to deal with modem signals), and UNKNOWN (which tells
  613. C-Kermit to attempt to honor modem signals, but leaves the dialing mechanism
  614. unspecified).  NONE is a synonym for DIRECT.
  615.  
  616. The device used for dialing out is the one selected in the most recent SET LINE
  617. command (or on a workstation, the default line if no SET LINE command was
  618. given).  On Unix systems, the DIAL command attempts to lock the terminal
  619. device's path and to establish a call on an exclusive basis.  If it is desired
  620. to dial a call and then return to the shell (such as to do Kermit activities
  621. depending on standard in/out redirection), it is necessary to place the dialed
  622. call under one device name (say, "/dev/cua0") and then escape to the shell
  623. within Kermit on a linked device which is separate from the dialed line (say,
  624. "/dev/cul0").  This is the same technique used by uucp (to allow locks to be
  625. placed separately for dialing and conversing).
  626.  
  627. Because modem dialers have strict requirements to override the carrier-detect
  628. signal most Unix implementations expect, the sequence for dialing is more rigid
  629. than most other C-Kermit procedures.  Example:
  630.  
  631.     kermit
  632.     C-Kermit>set modem hayes      ; SET MODEM first!
  633.     C-Kermit>set carrier auto     ; Then SET CARRIER if necessary,
  634.     C-Kermit>set line /dev/acu2   ; Then SET LINE,
  635.     C-Kermit>set speed 2400       ; Then SET SPEED,
  636.     C-Kermit>set dial display on  ; Then SET DIAL if necessary,
  637.     C-Kermit>dial 9,5551212       ; and finally, DIAL.
  638.     Connected!                         ; If DIAL completes OK,
  639.     C-Kermit>connect              ; you can CONNECT.
  640.     logon, do things
  641.     ^\c
  642.     C-Kermit> ...
  643.     C-Kermit>quit                 ; Disconnect & unlock the line.
  644.  
  645. In general, C-Kermit requires that the modem provide the "carrier detect" (CD)
  646. signal when a call is in progress, and remove that signal when the call
  647. completes or the line drops.  If a modem switch setting is available to force
  648. CD, it should normally not be in that setting.  C-Kermit also requires (on most
  649. systems) that the modem track the computer's "data terminal ready" (DTR)
  650. signal.  If a switch setting is available to simulate DTR asserted within the
  651. modem, then it should normally not be in that setting.  Otherwise the modem
  652. will be unable to hang up at the end of a call or when interrupts are received
  653. by Kermit.
  654.  
  655. If you want to interrupt a DIAL command in progress (for instance, because you
  656. just realize that you gave it the wrong number), type a Control-C get back to
  657. command level.  If you are a UNIX user and your "interrupt character" is
  658. defined as something besides Ctrl-C, use that instead.
  659.  
  660. PROBLEMS: The DIAL command hangs up the phone (see HANGUP) prior to dialing.
  661. Because of the problems described for HANGUP, certain UNIX configurations are
  662. unable to use DIAL when it does this.  To work around this problem, give the
  663. command SET DIAL HANGUP OFF before giving the DIAL command.  If DIAL still
  664. doesn't work right, start over again but this time give the command SET CARRIER
  665. OFF prior to SET LINE.
  666.  
  667. See the command summary for a description of SET DIAL options.  You can use SET
  668. DIAL to modify the modem initialization string, the timeout period for call
  669. completion, and so on.
  670.  
  671. Hayes and Hayes-compatible, as well as Telebit, modem dialing is supported for
  672. both word and digit result codes, and C-Kermit will also attempt to adjust its
  673. communication speed in case these modems complete a call at a lower speed than
  674. it was placed at (if you have a speed-matching modem, you can defeat this
  675. action by giving the command SET DIAL SPEED-MATCHING ON before dialing).
  676.  
  677.  
  678. The HANGUP Command
  679.  
  680. The HANGUP command attempts to hang up the modem on a local-mode dialout
  681. connection established by SET LINE, or to hang up the network connection
  682. established by SET HOST, in order to break the connection.  On terminal
  683. devices, Kermit accomplishes the hangup by momentarily turning off the Data
  684. Terminal Ready (DTR) RS-232 signal.
  685.  
  686. The means used to drop DTR and bring it back up again are highly dependent on
  687. the computer, the version of UNIX, the communication device, the device driver,
  688. the modem being used, and even the cable that connects the modem to the
  689. communication device.  Therefore you might find that this command fails to
  690. operate as it should.
  691.  
  692. If the HANGUP command fails to hang up a phone connection, then maybe your
  693. modem is configured to ignore DTR.  You should make sure your modem is
  694. configured to pay attention to the computer's DTR signal.  Another possibility
  695. is that your cable is giving the modem a constant DTR signal, looped back from
  696. its own DSR signal; in that case, replace your cable with a regular
  697. straight-through modem cable.
  698.  
  699. If the HANGUP command does indeed hang up the phone connection, but then you
  700. can't communicate with the modem any more to establish a new connection, your
  701. version of UNIX may have dropped the DTR signal without bringing it back up
  702. again properly.  To work around this problem, give the SET LINE command (with
  703. no device name) to close the current device, and then another SET LINE command
  704. specifying the original device to open it again.
  705.  
  706.  
  707. The TELNET Command
  708.  
  709. Syntax: TELNET [ host [ service ] ]
  710.  
  711. The TELNET command can be used in C-Kermit implementations that support TCP/IP
  712. networking.  TELNET is simply a shorthand for SET HOST followed by CONNECT.  If
  713. you give an IP host name (or number), Kermit closes any currently open
  714. connection and begins a new one to the given host.  If the TCP/IP connection is
  715. made successfully, Kermit puts itself into CONNECT mode for terminal emulation.
  716. If you give a TELNET command without a hostname, the currently active TCP/IP
  717. session (if any) is resumed; if there is no current session, you'll get an
  718. error message.  The service can be a TCP port number or service name; the
  719. default is TELNET (port 23).
  720.  
  721.  
  722. 1.5. File Transfer
  723.  
  724. Kermit programs can transfer files correctly and completely, using the Kermit
  725. file transfer protocol.  A Kermit program must be running on both computers.
  726. Here is the normal procedure:
  727.  
  728.    1. Run Kermit on your local computer.
  729.  
  730.    2. Make the appropriate communication settings (such as modem type,
  731.       line, speed, parity, etc).
  732.  
  733.    3. Establish a connection to the remote computer (DIAL if necessary).
  734.  
  735.    4. CONNECT to the remote computer.
  736.  
  737.    5. Log in to the remote computer if necessary.
  738.  
  739.    6. Start Kermit on the remote computer and tell it to send (or receive)
  740.       a file (or files).
  741.  
  742.    7. "Escape back" to the local computer.
  743.  
  744.    8. Tell the local computer to receive (or send) a file (or files).
  745.  
  746. When transferring files, C-Kermit converts between upper and lower case
  747. filenames and between LF and CRLF line terminators automatically, unless told
  748. to do otherwise.  When binary files must be transferred, the program should be
  749. instructed not to perform LF/CRLF conversion (-i on the command line or SET
  750. FILE TYPE BINARY interactively; see below).
  751.  
  752. If C-Kermit is in local mode, the screen is continously updated to show the
  753. progress of the file transer.  A dot is printed for every four data packets,
  754. other packets are shown by type:
  755.  
  756.     I Exchange Parameter Information
  757.     R Receive Initiation
  758.     S Send Initiatiation
  759.     A Attribute Packet
  760.     F File Header
  761.     G Generic Server Command
  762.     C Remote Host Command
  763.     N Negative Acknowledgement (NAK)
  764.     E Fatal Error
  765.     T Indicates a timeout occurred
  766.     Q Indicates a damaged, undesired, or illegal packet was received
  767.     % Indicates a packet was retransmitted
  768.  
  769. You may type the following interruption commands during file transfer:
  770.  
  771.     F Interrupt the current File, and go on to the next (if any).
  772.     X Interrupt the entire Batch of files, terminate the operation.
  773.     R Resend the current packet.
  774.     E Error: terminate the current operation immediately and return to prompt.
  775.     A Display a status report for the current operation.
  776.  
  777. EMERGENCY EXIT:  When running C-Kermit in remote mode, if you have started a
  778. protocol operation (sending or receiving a file, server command wait, etc), you
  779. can type two Control-C's directly to the Unix Kermit program ("connect" first
  780. if necessary):
  781.  
  782.     Control-C Control-C
  783.  
  784. This will cause the program to display,
  785.  
  786.     ^C^C...
  787.  
  788. and return you to the C-Kermit prompt.
  789.  
  790. Before initiating a file transfer, you should be sure that all communication
  791. and protocol-related settings are correct.  Version 5A of Kermit attempts to
  792. make things easier for you in this area in several ways, for example by
  793. recognizing file attributes (text or binary, character set, etc) from the other
  794. Kermit if it sends them.  If your parity is set to NONE, C-Kermit automatically
  795. recognizes parity bits on received packets, and adjusts its parity accordingly.
  796. But it's better to set these C-Kermit parameters directly yourself to avoid any
  797. confusion that might result from these automatic adjustments.
  798.  
  799.  
  800. The SEND Command
  801.  
  802. Syntax:  SEND fn [ rfn1 ]
  803.  
  804. Send the file or files denoted by fn to the other Kermit, which should be
  805. running as a server, or which should be given the RECEIVE command.  The SEND
  806. command may be abbreviated to S, even though S is not a unique abbreviation for
  807. a top-level C-Kermit command.  Each file is sent under its own name (as
  808. described above, or as specified by the 'set file names' command).  If the
  809. second form of the SEND command is used, i.e. with fn1 denoting a single file,
  810. rfn1 may be specified as a name to send it under.  For example:
  811.  
  812.     send sows.ear silk.purse
  813.  
  814. sends the file sows.ear but tells the other Kermit that its name is silk.purse.
  815.  
  816.  
  817. The MSEND Command
  818.  
  819. Syntax:  MSEND fn [ fn [ fn [ ... ] ] ]
  820.  
  821. The MSEND command also sends one or more files, but unlike the SEND command, it
  822. allows you to give a list of files to send, and it does not allow you to
  823. specify an alternate name.  The MSEND file specifications are separated by
  824. spaces.
  825.  
  826. Both the SEND and MSEND commands allow you to use wildcard (meta) characters to
  827. specify groups of files.  Exactly which wildcard characters are available
  828. depend on the host operating system and other factors.  In VAX/VMS, they are
  829. `*' and `%'.  In UNIX they are `~', `*', and `?'.  If `?'  is to be included,
  830. it must be prefixed by `\' to override its normal function of providing help.
  831. The `*' character matches any string, and `?' (UNIX) or `%' (VMS) matches any
  832. single character.
  833.  
  834. When fn contains `*' or `?' characters, there is a limit to the number of files
  835. that can be matched, which varies from system to system.  If you get the
  836. message "Too many files match" then you'll have to make a more judicious
  837. selection.  For example, if fn was of the form:
  838.  
  839.     usr/longname/anotherlongname/*
  840.  
  841. then C-Kermit's string space will fill up rapidly -- try using CD to change
  842. your directory to the path in question and reissuing the command.
  843.  
  844. Wildcards do not descend through a directory tree.  Only files in the current
  845. or specified directory are sent.
  846.  
  847. In UNIX versions of C-Kermit only, `~' is treated as a meta character if it is
  848. the first character in the file specification. If it is followed immediately by
  849. a slash, a space, or end of line, then your login directory name is
  850. substituted.  If it is followed immediately by a username, then that user's
  851. login directory name is substituted.  (In VAX/VMS, you can use logical names in
  852. the file specification for the same purpose.)
  853.  
  854. Wildcard Notation for UNIX
  855.  
  856. Normally, C-Kermit expands wildcard characters itself by searching through the
  857. disk and matching names against the pattern you specify.  But Kermit's
  858. pattern-matching abilities are limited to the metacharacters listed above.
  859. UNIX shells like csh and ksh, on the other hand, offer notations for file
  860. groups, like `[bcdfhjlns]og' or `*.{txt,doc}' that Kermit cannot handle on its
  861. own.  Kermit lets you get at these capabilities with the command:
  862.  
  863. SET WILDCARD-EXPANSION { KERMIT, SHELL }
  864.  
  865. The default is KERMIT, meaning Kermit itself expands wildcards in SEND and
  866. MSEND, as well as what it receives while in server mode from GET commands.  The
  867. SHELL option means Kermit calls upon the user's preferred shell (via the SHELL
  868. environment variable, or failing that, the user's login shell via getpwuid) to
  869. expand them.
  870.  
  871. Advantages of the SHELL method include more flexibility in file selection,
  872. consistency with the user's shell, and ability to handle a larger number of
  873. files.  But there are drawbacks.  It's noticably slower.  Characters in
  874. filenames that are special to the shell (like |, &, `, etc) must be quoted with
  875. \ (this is not necessary when Kermit expands).  And the same Kermit command
  876. (SEND, MSEND, or GET sent to a server) may behave differently depending on what
  877. your login shell is.  For example, "{aaa,bbb}" is expanded by the csh, but
  878. taken literally by sh and ksh; "[a-z]" is expanded by csh and ksh, but taken
  879. literally by sh.
  880.  
  881. The expansion is done by passing "echo " concatenated with the user's filespec
  882. to the shell.  This assumes that echo is a built-in shell command, or if it's
  883. not, then the echo program is in the user's path (risky).  "echo" is used
  884. rather than "ls -d" because ls says "xxx not found" if xxx does not exist
  885. (unfortunately, the csh version of "echo" says "echo: no match" if you give it
  886. a string containing metacharacters and no files match, wherease sh and ksh
  887. simply echo the string back at you).  It doesn't matter much, because C-Kermit
  888. checks each word that is returned for its existence as a file (but of course,
  889. you could have a file called "echo:", "no", or "match"...).  And then what
  890. happens if your have a file called "-n"?  ("echo -n" is a command.  Refer to a
  891. file called "-n" in the current directory as "./-n").
  892.  
  893. Text vs Binary Files
  894.  
  895. When C-Kermit sends each file, it also sends certain information about the file
  896. in an "attribute packet", provided the other Kermit agrees to accept attribute
  897. packets.  This information includes the size, type (text or binary, determined
  898. from the "-i" command-line option or the "set file type" command), creation
  899. date, and a code to let the other Kermit know that the file is being sent from
  900. a Unix system.  The other Kermit may accept or refuse the file based upon these
  901. attributes, for example, if it doesn't have enough disk space to store a file
  902. of the specified size.
  903.  
  904. The file type attribute allows C-Kermit, when sending a file, to tell the
  905. receiving whether it should be in text or binary mode.  Therefore, if the
  906. receiving Kermit has this feature, it is not necessay to give it a SET FILE
  907. TYPE command to "match modes" with C-Kermit.
  908.  
  909. Note -- C-Kermit sends only from the current or specified directory.  It does
  910. not traverse directory trees.  If the source directory contains subdirectories,
  911. they will be skipped.  By the same token, C-Kermit does not create directories
  912. when receiving files.  If you have a need to do this, you can pipe tar through
  913. C-Kermit, as shown in the example in section 1.14, or under AT&T System III/V
  914. Unix you can use cpio, or BACKUP under VAX/VMS, etc.
  915.  
  916. Another Note -- The SEND command skips over "invisible" files that match the
  917. file specification; Unix systems usually treat files whose names start with a
  918. dot (like .login, .cshrc, and .kermrc) as invisible.  If you want to send
  919. these, include the dot in your filespec, as in:
  920.  
  921.     send .*
  922.  
  923.  
  924. The RECEIVE Command
  925.  
  926. Syntax:  RECEIVE [fn1]
  927.  
  928. Passively wait for files to arrive from the other Kermit, which must be given
  929. the SEND command -- the RECEIVE command does not work in conjunction with a
  930. server (use GET for that).  If fn1 is specified, store the first incoming file
  931. under that name.  The RECEIVE command may be abbreviated to R.
  932.  
  933. Incoming file data is normally decoded and stored according to whether C-Kermit
  934. is in text or binary mode.  But if the other Kermit sends the file-type
  935. attribute, this will override C-Kermit's file-type setting on a per-file basis.
  936. Therefore, it is possible for another Kermit program to send C-Kermit a mixture
  937. of text and binary files, so long as the type of each file is indicated in the
  938. Attribute packet.  For text files, C-Kermit will perform character-set
  939. translation if a known transfer character set is indicated in the Attribute
  940. packet (see section on International Characters).
  941.  
  942. C-Kermit also attempts to store the incoming file with the creation date that
  943. is specified in the Attribute packet.  C-Kermit does not attempt to verify disk
  944. space against the announced size of the incoming file.
  945.  
  946. You can control C-Kermit's use of these attributes using the SET ATTRIBUTE
  947. command.
  948.  
  949.  
  950. The STATISTICS Command
  951.  
  952. The STATISTICS command displays information about the most recent Kermit file
  953. transfer or other protocol transaction, including file and communication line
  954. input and output, timing and efficiency, as well as what encoding options were
  955. in effect (such as 8th-bit prefixing, repeat-count compression, packet lengths,
  956. window size).
  957.  
  958.  
  959. Non-Protocol Data Transfers
  960.  
  961. It is also possible to transfer files with other computers that do not have a
  962. Kermit program available.  To send a file to such a computer, use the TRANSMIT
  963. command:
  964.  
  965. Syntax: TRANSMIT fn1
  966.  
  967. This command sends the named file without error checking, obeying current
  968. settings for file type (text or binary), parity, and duplex.
  969.  
  970. In text mode, send the file a line at a time, with character translations done
  971. according to the current file and transfer character sets, using the SET
  972. TRANSMIT PROMPT character (linefeed, \10, by default) as a line turnaround
  973. character.  That is, send a line from the file, wait until the prompt character
  974. comes in response, then send the next line, and so on.  If zero (0) is
  975. specified for the prompt character, then send the whole file without waiting
  976. for any response or echo from the host.  Don't try this unless you know that
  977. the host can successfully process long continuous bursts of input characters.
  978. Each line is terminated by a carriage return, just as you would type it at a
  979. terminal.  Linefeeds are stripped unless you have given the command SET
  980. TRANSMIT LINEFEED ON.  The computer to which you are transmitting the file
  981. should be prepared to receive it, for instance into a text editor.
  982.  
  983. In binary mode, send all the characters of the file with no modification and no
  984. line turnaround handshake (the TRANSMIT PROMPT setting is ignored).  Use binary
  985. mode only if you know that the computer or device to which you are transmitting
  986. the file can receive arbitrary patterns of characters at full speed.
  987.  
  988. If you want to transmit 8-bit data over a 7-bit connection (i.e. PARITY is not
  989. NONE), you can use SET TRANSMIT LOCKING-SHIFT ON to have Kermit send SO/SI
  990. shifts around your 8-bit characters.  The TRANSMIT command can be interrupted
  991. by typing Ctrl-C.  Also see SET TRANSMIT.
  992.  
  993. The opposite of TRANSMIT is LOG SESSION, which lets you capture files or screen
  994. data from remote computers during CONNECT, also without error checking.
  995.  
  996. XMIT may be used as a synonym for TRANSMIT in the TRANSMIT, SET TRANSMIT, and
  997. SHOW TRANSMIT commands.
  998.  
  999.  
  1000. 1.6. Being and Using a Kermit Server
  1001.  
  1002. The SERVER command places C-Kermit in "server mode" on the currently selected
  1003. communication device or network connection.  All further commands must arrive
  1004. as valid Kermit packets from the Kermit on the other end of the line.  If you
  1005. are running C-Kermit on the remote computer, then you should escape back to
  1006. your local computer after you give C-Kermit the SERVER command, and then issue
  1007. all further commands to the C-Kermit server from your local Kermit's command
  1008. prompt.  It is also possible to work the other way: your local computer is the
  1009. Kermit server and the remote computer issues the commands -- this can only work
  1010. if the remote Kermit is driven by a TAKE command file (which should end with
  1011. the command FINISH).
  1012.  
  1013. The C-Kermit server can respond to the following commands from the client:
  1014.  
  1015.   Client Command         Server Response
  1016.     GET                    Sends files
  1017.     SEND                   Receives files
  1018.     MAIL                   Sends incoming files as e-mail to specified address
  1019.     BYE                    Attempts to log itself out
  1020.     FINISH                 Exits to level from which it was invoked
  1021.     REMOTE CD              Changes working directory (also, remote cd)
  1022.     REMOTE DIRECTORY       Sends directory listing
  1023.     REMOTE DELETE          Removes files
  1024.     REMOTE HELP            Lists these capabilities
  1025.     REMOTE HOST            Executes a Unix shell command
  1026.     REMOTE KERMIT          Sends a Kermit command to a Kermit server
  1027.     REMOTE LOGIN           Login to a Kermit server that requires this
  1028.     REMOTE LOGOUT          Logout from a Kermit server
  1029.     REMOTE PRINT           Receives a file and prints it
  1030.     REMOTE SET             Changes its settings
  1031.     REMOTE SPACE           Reports about its disk usage
  1032.     REMOTE TYPE            Sends files to your screen
  1033.     REMOTE WHO             Shows who's logged in
  1034.  
  1035. If the Kermit server is directed at an external line (i.e. it is in "local
  1036. mode") then the console may be used for other work if you SET FILE DISPLAY OFF
  1037. and run it in the background; normally the program expects the console to be
  1038. used to observe file transfers and enter status queries or to interrupt
  1039. commands.  The way to get C-Kermit into background operation from interactive
  1040. command level varies from system to system (e.g. on Berkeley Unix you would
  1041. halt the program with ^Z and then use the C-Shell 'bg' command to continue it
  1042. in the background).  The more common method is to invoke the program with the
  1043. desired command line arguments, including "-q", and with a terminating "&".
  1044.  
  1045. The C-Kermit server will accept a list of files in GET commands sent by the
  1046. client, similar to the list you can give to the MSEND command, e.g.:
  1047.  
  1048.     MS-Kermit>get ~joe/new.txt /etc/termcap ../*.c
  1049.  
  1050. The file specifications are separated by spaces.  If you need to include a
  1051. space in a filename, quote it with a backslash, for example:
  1052.  
  1053.     MS-Kermit>get node"user\ passwd"::dev:[dir]name.ext
  1054.  
  1055. If you need to include a backslash, use two of them.
  1056.  
  1057. When the Unix Kermit server is given a REMOTE HOST command, it executes it
  1058. using the shell invoked upon login, e.g. the Bourne shell, the Korn Shell, or
  1059. the Berkeley C-Shell (or whatever the user has set her SHELL environment
  1060. variable to be).
  1061.  
  1062. The server can issue periodic NAK packets.  You can control the rate at which
  1063. this happens via SET SERVER TIMEOUT.  Specifiying a value of zero instructs
  1064. C-Kermit not to do this at all.  A nonzero value, n, makes a NAK appear every n
  1065. seconds during server command wait.  This is useful if the client Kermit is not
  1066. capable of timeouts, and a packet that it sends to the server is lost.  The
  1067. default server timeout is zero.
  1068.  
  1069. SECURITY.  Before putting C-Kermit into server mode, you can give it commands
  1070. to restrict the types of access it allows to clients.  The command is DISABLE.
  1071. You can turn these accesses back on using the ENABLE command.  Here are the
  1072. items that can be controlled in this way, with the effect of DISABLE noted.
  1073. CAUTION: If you leave HOST enabled, the client can get around some of these
  1074. restrictions with REMOTE HOST commands.
  1075.  
  1076. BYE             Ignore BYE commands from the client, stay in server mode.
  1077. CD              Don't let the client change directories, or send files to, or
  1078.                 get files from, or delete or type files in, any but the current
  1079.                 directory, nor inquire about space in any but the current
  1080.                 directory.
  1081. DELETE          Don't let the client delete any files.
  1082. DIRECTORY       Don't let the client request a directory listing.
  1083. FINISH          Ignore FINISH commands from the client, stay in server mode.
  1084. GET             Don't let the client GET files.
  1085. HOST            Ignore REMOTE HOST commands from the client.
  1086. SEND            Don't accept files that the client tries to send.
  1087. SET             Refuse REMOTE SET commands from the client.
  1088. SPACE           Refuse REMOTE SPACE commands from the client.
  1089. TYPE            Refuse REMOTE TYPE commands from the client.
  1090. WHO             Refuse REMOTE WHO commands from the client.
  1091. ALL             All of the above.
  1092.  
  1093.  
  1094. Using a Kermit Server
  1095.  
  1096. C-Kermit may itself request services from a remote Kermit server.  To send a
  1097. file to a Kermit server, use the SEND command, just as you would to send a file
  1098. to a Kermit program that has been given the RECEIVE command.  But you cannot
  1099. use the RECEIVE command to get a file from a Kermit server, because the RECEIVE
  1100. command just waits passively for a file to arrive, but the server has not been
  1101. told which file to send.  For this, you need the GET command:
  1102.  
  1103. Syntax:  GET rfn
  1104.  
  1105.         or: GET
  1106.                 rfn
  1107.                 fn1
  1108.  
  1109. The GET command requests a remote Kermit server to send the named file or
  1110. files, it must be used in place of RECEIVE.  Since a remote file specification
  1111. (or list) might contain spaces, which normally delimit fields of a C-Kermit
  1112. command, an alternate form of the command is provided to allow the inbound file
  1113. to be given a new name: type GET alone on a line, and you will be prompted
  1114. separately for the remote and local file specifications, for example:
  1115.  
  1116.     C-Kermit>get
  1117.      Remote file specification: profile exec
  1118.      Local name to store it under: profile.exec
  1119.  
  1120. If a `?' is to be included in the remote file specification, you must prefix it
  1121. with `\' to suppress its normal function of providing help.
  1122.  
  1123. If you have started a multiline GET command, you may escape from its lower-
  1124. level prompts by typing a carriage return in response to the prompt, e.g.
  1125.  
  1126.     C-Kermit>get
  1127.      Remote file specification: foo
  1128.      Local name to store it under: (Type a carriage return here)
  1129.     (cancelled)
  1130.     C-Kermit>
  1131.  
  1132. After the GET command has been entered, the file transfer proceeds exactly as
  1133. if you had given a SEND command to the other Kermit and a RECEIVE command to
  1134. this one.
  1135.  
  1136. In addition to SEND and GET, the following commands may also be sent from
  1137. C-Kermit to a Kermit server.  If the server does not support a command that you
  1138. send to it, it will respond with a message like "Unknown server command" or
  1139. "Unimplemented REMOTE command".
  1140.  
  1141.     REMOTE CD [directory]
  1142.         Request the server to change its default directory (and/or device) to
  1143.         the one you specify.  If none is specified, the server is requested to
  1144.         return to its primary default directory (normally the login directory).
  1145.  
  1146.  
  1147.     REMOTE DELETE rfn
  1148.         The server is requested to delete the specified file or files.
  1149.  
  1150.  
  1151.     REMOTE DIRECTORY [rfn]
  1152.         The server is requested to send a directory listing of the specifed
  1153.         files.  If no files are specified, then the server should send a
  1154.         listing of all the files in the current directory.
  1155.  
  1156.  
  1157.     REMOTE HELP
  1158.         The server is requested to send to your screen a list of the commands
  1159.         that you may issue to it from your local Kermit.
  1160.  
  1161.  
  1162.     REMOTE HOST command
  1163.         The server is requested to ask its host operating system to execute the
  1164.         given command.
  1165.  
  1166.  
  1167.     REMOTE KERMIT command
  1168.         The remote server is requested to execute the given command, which is
  1169.         in its own (Kermit program) syntax.
  1170.  
  1171.  
  1172.     REMOTE LOGIN userid password [account]
  1173.         If a remote Kermit server has been set up to require to provide a user
  1174.         ID and password before you can gain access to it, use this command to
  1175.         send it the user ID and password.
  1176.  
  1177.  
  1178.     REMOTE LOGOUT
  1179.         Remove your access from a remote Kermit server that you have REMOTE
  1180.         LOGIN'ed to.
  1181.  
  1182.  
  1183.     REMOTE PRINT file [options]
  1184.         The file is sent to the server, which is requested via Attribute packet
  1185.         to print it on its printer using the specified print options.
  1186.  
  1187.  
  1188.     REMOTE SET parameter value
  1189.         The server is requested to set the given parameter to the specified
  1190.         value.  Use question mark to find out what parameters and values are
  1191.         available.  The meanings of these parameters and values are explained
  1192.         in the section on the SET command, below.  Perhaps the most useful one
  1193.         is REMOTE SET FILE TYPE { TEXT, BINARY }.
  1194.  
  1195.  
  1196.     REMOTE SPACE [dir]
  1197.         The server is requested to report on available disk space in the
  1198.         specified device and/or directory, or in the current area if none
  1199.         specified.
  1200.  
  1201.  
  1202.     REMOTE TYPE [rfn]
  1203.         The server is requested to send the specified file for display on your
  1204.         screen.
  1205.  
  1206.  
  1207.     REMOTE WHO [user]
  1208.         The server is requested to send a list of the users who are logged in
  1209.         on its computer.  If a username is given, information about that user
  1210.         is requested.
  1211.  
  1212.  
  1213.     BYE and FINISH:
  1214.         When connected to a remote Kermit server, these commands cause the
  1215.         remote server to terminate; FINISH returns it to Kermit or system
  1216.         command level (depending on the implementation or how the program was
  1217.         invoked); BYE also requests it to log itself out.
  1218.  
  1219.  
  1220. 1.7. International Character Sets
  1221.  
  1222. Text files may be written in languages other than English, and in most cases
  1223. that means that they contain non-ASCII characters such as accented letters,
  1224. special punctuation marks, etc.  Many different character sets have been
  1225. devised to represent different languages.  These character sets are sometimes
  1226. specific to a particular computer manufacturer, and sometimes they conform to
  1227. one standard or another.  The Kermit file transfer protocol permits Kermit
  1228. programs to exchange files written in different character sets by translating
  1229. between each computer's local file character set and a standard set that is
  1230. used "on the wire".  Here are the relevant commands:
  1231.  
  1232.     SET FILE TYPE TEXT
  1233.         Character set translation is not done at all unless the file type is
  1234.         text.
  1235.  
  1236.  
  1237.     SET TRANSFER CHARACTER-SET name
  1238.         Tell C-Kermit which character set is to be used on the wire, i.e.
  1239.         within the Kermit packets.  The choices are TRANSPARENT (no
  1240.         translation, this is the default), ASCII (translate to/from US ASCII),
  1241.         LATIN1 (ISO 8859-1 Latin Alphabet 1), CYRILLIC-ISO (ISO 8859-5
  1242.         Latin/Cyrillic Alphabet), and JAPANESE-EUC.  Synonym: SET XFER
  1243.         CHARACTER-SET.
  1244.  
  1245.  
  1246.     SET FILE CHARACTER-SET name
  1247.         Tell C-Kermit which character set is used in the local file, ASCII, or
  1248.         any of a dozen or so 7-bit national replacement character sets (NRCs)
  1249.         such as ITALIAN, NORWEGIAN, etc, or an 8-bit character set like LATIN1,
  1250.         DEC-Multinational, DG-Multinational, NEXT (for NeXT workstations),
  1251.         CP437 or CP850 (for IBM or Xenix systems), APPLE (for A/UX on the
  1252.         Macintosh); CP866, KOI8-CYRILLIC, CYRILLIC-ISO, and SHORT-KOI for
  1253.         Cyrillic; and JAPANESE-EUC, DEC-KANJI, SHIFT-JIS, and JIS7 for Japanese
  1254.         Kanji.
  1255.  
  1256.  
  1257.     SET LANGUAGE name
  1258.         Enable certain language-specific translations, especially for DUTCH,
  1259.         ICELANDIC, GERMAN, RUSSIAN, and the Scandinavian languages.  In
  1260.         particular, SET LANGUAGE RUSSIAN makes Kermit treat ASCII as if it were
  1261.         SHORT-KOI when it is a FILE or TRANSFER character set, and the
  1262.         corresponding TRANSFER or FILE character set is an 8-bit Cyrillic set.
  1263.  
  1264.  
  1265.     TRANSLATE file1 cs1 cs2 [ file2 ]
  1266.         Translate the local file file1 from the character set cs1 into the
  1267.         character set cs2.  Both character sets may be selected from C-Kermit's
  1268.         repertoire of file character sets.  The result is stored in file2 or
  1269.         (if file2 is not specified), displayed on the screen.  If LANGUAGE is
  1270.         set to RUSSIAN, ISO Latin-Cyrillic is used as the intermediate standard
  1271.         character set during translation, otherwise ISO Latin Alphabet 1 is
  1272.         used.  Does not yet work for Kanji.
  1273.  
  1274. The SET commands are described in more detail later.
  1275.  
  1276. When sending a file, C-Kermit translates the file from the specified file
  1277. character set into the specified transfer character set, and an identifier for
  1278. the selected transfer character set is included in the file attribute packet,
  1279. if use of attribute packets has been negotiated and a SET ATTR [CHARACTER-SET]
  1280. OFF command has not been given.
  1281.  
  1282. When receiving, C-Kermit translates from the specified transfer character set
  1283. to the specified file character set or, if a transfer character set is
  1284. identified in the incoming attribute packet it is used instead.  If the file
  1285. character set is ASCII and special characters are being received, then they are
  1286. translated by stripping diacritical marks and aiming for the closest possible
  1287. 1-to-1 translation on a per-character basis.  But if a SET LANGUAGE command has
  1288. been given, special translations can be done.  For example if LANGUAGE has been
  1289. set to GERMAN and the local file character set is ASCII, and a file arrives
  1290. with a transfer character set of LATIN1, then C-Kermit will translate German
  1291. umlaut-vowels into the corresponding vowels followed by the letter e, and
  1292. German double-s into two s's.  Similar translations take effect for other
  1293. languages.
  1294.  
  1295. If unwanted effects appear because of Kermit's translation, you can disable
  1296. this feature with SET ATTRIBUTE CHARACTER-SET OFF.
  1297.  
  1298. When transferring text that contains long runs of 8-bit data over a 7-bit
  1299. communication channel, efficiency can be improved with the following command:
  1300.  
  1301.     SET TRANSFER LOCKING-SHIFT { OFF, ON, FORCED }
  1302.         Specifies whether locking shifts should be used by Kermit when encoding
  1303.         and decoding packets.  A locking shift is a special character, Ctrl-N
  1304.         (Shift-Out, SO), that means that all the following characters, up to
  1305.         the next Ctrl-O (Shift-In, SI), are to have their 8th bits set to 1
  1306.         upon receipt.  For long runs of 8-bit characters, this is more
  1307.         efficient than Kermit's regular "single shift" method of prefixing each
  1308.         8-bit character by an &-sign.  Synonym: SET XFER LOCKING-SHIFT.  The
  1309.         options are:
  1310.  
  1311.         ON  This is the default setting.  If PARITY is not NONE, try to
  1312.             negotiate the use of locking shift protocol with the other Kermit,
  1313.             and use it if the other Kermit agrees.  If PARITY is NONE, locking
  1314.             shifts won't be used.
  1315.  
  1316.  
  1317.         OFF Don't use locking shifts.
  1318.  
  1319.  
  1320.         FORCED
  1321.             Use locking shifts, regardless of the parity setting and
  1322.             negotiations.  Automatically disables the use of 8th-bit prefixing
  1323.             (single shifts).  For the file sender, this command lets data be
  1324.             sent to the receiver with embedded SO and SI characters, which can
  1325.             be processed properly by many terminals, printers, and other
  1326.             devices.  For the file receiver, this command forces the treatment
  1327.             of SO and SI characters in the data as shift commands.
  1328.  
  1329. Locking shifts are most effective for text written in non-Roman alphabets and
  1330. encoded in standard 8-bit character sets like ISO Latin/Cyrillic, ISO
  1331. Latin/Arabic, ISO Latin/Hebrew, ISO Latin/Greek, or Japanese EUC.
  1332. Locking-shift status is displayed by the SHOW and STATISTICS commands.
  1333.  
  1334.  
  1335. 1.8. Logging Things
  1336.  
  1337. Kermit's actions during terminal connection and file transfer can be logged in
  1338. several ways, using the LOG command:
  1339.  
  1340. Syntax: LOG {DEBUGGING, PACKETS, SESSION, TRANSACTIONS} [ fn1 [ { APPEND, NEW
  1341. }=NEW ] ]
  1342.  
  1343. C-Kermit's progress may be logged in various ways.  The LOG command opens a
  1344. log, the CLOSE command closes it.  In addition, all open logs are closed by the
  1345. EXIT and QUIT commands.  A name may be specified for a log file; if the name is
  1346. omitted, the file is created with a default name as shown below.  If the
  1347. keyword APPEND is included at the end of the command, then if the specified
  1348. file exists, it is appended to rather than written over; if it does not exist,
  1349. a new file is created.
  1350.  
  1351. LOG DEBUGGING
  1352.     This produces a voluminous log of the internal workings of C-Kermit, of use
  1353.     to Kermit developers or maintainers in tracking down suspected bugs in the
  1354.     C-Kermit program.  Use of this feature slows down the Kermit protocol and
  1355.     fills up your disk.  Default name: debug.log.
  1356.  
  1357.  
  1358. LOG PACKETS
  1359.     This produces a record of all the packets that go in and out of the
  1360.     communication port.  This log is of use to Kermit maintainers who are
  1361.     tracking down protocol problems in either C-Kermit or any Kermit that
  1362.     C-Kermit is connected to.  Default name:  packet.log.
  1363.  
  1364.  
  1365. LOG SESSION
  1366.     This log will contain a copy of everything you see on your screen during
  1367.     the CONNECT command, except for local messages or interaction with local
  1368.     escape commands.  Default name:  session.log.
  1369.  
  1370.  
  1371. LOG TRANSACTIONS
  1372.     The transaction log is a record of all the files that were sent or received
  1373.     while transaction logging was in effect.  It includes time stamps and
  1374.     statistics, filename transformations, and records of any errors that may
  1375.     have occurred.  The transaction log allows you to have long unattended file
  1376.     transfer sessions without fear of missing some vital screen message.
  1377.     Default name:  transact.log.
  1378.  
  1379. The CLOSE command closes the named log, e.g. CLOSE DEBUG, CLOSE SESSION.
  1380.  
  1381. Note:  Debug and Transaction logs are a compile-time option; C-Kermit may be
  1382. compiled without these logs, in which case it will run faster, it will take up
  1383. less space on the disk, but the commands relating to them will not be present.
  1384.  
  1385.  
  1386. 1.9. Local File Management
  1387.  
  1388. C-Kermit allows the following local file management functions from its
  1389. interactive command level:
  1390.  
  1391. CD [directory-name]
  1392.     Changes Kermit's working device and/or directory to the one given, or to
  1393.     the user's default directory and/or device if the name is omitted.  This
  1394.     command affects only the Kermit process and any processes it may
  1395.     subsequently create.  You may use CWD and SET DEFAULT as synonyms for CD.
  1396.  
  1397. DELETE fn
  1398.     Deletes (removes, erases) file fn, which may be the name of a single file
  1399.     or a wildcard specification containing * and/or ?  characters.  You may use
  1400.     RM as a synonym for DELETE.
  1401.  
  1402. DIRECTORY [fn]
  1403.     Displays a listing of the files whose names match fn, which may be the name
  1404.     of a single file or a wildcard specification containing * and/or ?
  1405.     characters.  If no fn is given, C-Kermit lists all files in the current
  1406.     device and/or directory.  The format of and information provided in the
  1407.     listing depends on the operating system.  You may use LS as a synonym for
  1408.     DIRECTORY.
  1409.  
  1410. PWD (Print Working Directory) Display the current working (default) file device
  1411.     and/or directory.  You may use SHOW DEFAULT as a synonym for PWD.
  1412.  
  1413. PRINT fn1 [ options ]
  1414.     Print the local file fn1 on a local printer.  Options can be included after
  1415.     the filename, for example, to select a particular printer.  The options are
  1416.     in the format of the local system's printing command.
  1417.  
  1418. RENAME fn1 fn2
  1419.     Changes the name of file fn1 to fn2.  You may use MV as a synonym for
  1420.     RENAME.
  1421.  
  1422. SPACE
  1423.     Displays information about disk space and/or quota in the current directory
  1424.     and device.
  1425.  
  1426. TYPE fn
  1427.     Display the named file on the screen.  May be interrupted with Ctrl-C, and
  1428.     on most systems the display can be stopped and resumed with Ctrl-S and
  1429.     Ctrl-Q, respectively.  You may use CAT as a synonym for TYPE.
  1430.  
  1431. { @, !, RUN, PUSH }
  1432.     The command is executed by your computer's operating system command
  1433.     interpreter (UNIX shell, VMS DCL, etc).  If no command is specified, then
  1434.     an interactive session is started; exiting from this session, e.g. by
  1435.     typing Control-D or 'exit' to a UNIX shell, or LOGOUT to VMS DCL, will
  1436.     return you to C-Kermit command level.  Use the `!' command to provide file
  1437.     management or other functions not explicitly provided by C-Kermit commands.
  1438.     !, @, RUN, and PUSH are all synonyms for the same command.
  1439.  
  1440.  
  1441. 1.10. The SET and SHOW Commands
  1442.  
  1443. Since Kermit is designed to allow diverse computers to communicate, it is often
  1444. necessary to issue special instructions to allow Kermit to adapt to
  1445. peculiarities of the other computer or the communication path.  These
  1446. instructions are accomplished by the SET command.  The following parameters may
  1447. be SET:
  1448.      ATTRIBUTES  Turn Attribute packet processing on or off.
  1449.      BACKGROUND  Force foreground or background mode.
  1450.     BLOCK-CHECK  Level of packet error detection.
  1451.         BUFFERS  Send and receive packet buffer sizes.
  1452.         CARRIER  Treatment of carrier on terminal connections.
  1453.            CASE  Controls treatment of alphabetic case.
  1454.         COMMAND  Character set size for commands.
  1455.           COUNT  For counted loops.
  1456.           DEBUG  Log or display debugging information.
  1457.         DEFAULT  Default directory.
  1458.           DELAY  How long to wait before sending first packet.
  1459.            DIAL  Parameters for DIAL command.
  1460.          DUPLEX  Specify which side echoes during CONNECT.
  1461.          ESCAPE  Prefix for "escape commands" during CONNECT.
  1462.            FILE  Set various file parameters.
  1463.    FLOW-CONTROL  Communication line full-duplex flow control.
  1464.       HANDSHAKE  Communication line half-duplex turnaround character.
  1465.            HOST  Specify network host name.
  1466.      INCOMPLETE  Disposition for incompletely received files.
  1467.           INPUT  Control behavior of INPUT command.
  1468.        LANGUAGE  Enable language-specific character-set translations.
  1469.            LINE  Communication line device name.
  1470.           MACRO  Control aspects of macro execution.
  1471.    MODEM-DIALER  Type of modem-dialer on communication line.
  1472.             PAD  (X.25 systems only) X.3 PAD parameters.
  1473.          PARITY  Communication line character parity.
  1474.          PROMPT  The C-Kermit program's interactive command prompt.
  1475.         RECEIVE  Parameters for inbound packets.
  1476.           RETRY  Packet retransmission limit.
  1477.          SCRIPT  Parameters for the SCRIPT command.
  1478.            SEND  Parameters for outbound packets.
  1479.          SERVER  Parameters for server operation.
  1480.     SESSION-LOG  (UNIX only) Session log file type, text or binary.
  1481.           SPEED  Communication line speed.
  1482.         SUSPEND  Enable/Disable SUSPEND.
  1483.            TAKE  Control aspects of TAKE file execution.
  1484.        TERMINAL  Terminal parameters.
  1485.        TRANSFER  File transfer parameters.
  1486.        TRANSMIT  Control aspects of TRANSMIT command execution.
  1487.         UNKNOWN  Specify handling of unknown character sets.
  1488.          WINDOW  File transfer packet window size.
  1489.        WILDCARD  (UNIX only) Kermit vs shell wildcard expansion.
  1490.            X.25  (X.25 systems only) X.25 call parameters
  1491.  
  1492. The SHOW command may be used to display current settings.  Here is a summary of
  1493. settings available in C-Kermit, listed alphabetically.
  1494.  
  1495. SET ATTRIBUTES
  1496.     Tells C-Kermit whether to exchange file attribute (A) packets, or whether
  1497.     to include specified attributes within the A packets it sends, or whether
  1498.     to pay attention to specific attributes in A packets it receives.  When the
  1499.     use of A packets has been negotiated, C-Kermit enables and uses the ones
  1500.     listed below.  When sending files, C-Kermit responds to an Attribute
  1501.     refusal from the other computer by not sending the specified file.  For
  1502.     example, if C-Kermit announces in the A packet that the file is 100K long,
  1503.     the other Kermit could refuse the file because of insufficient disk space,
  1504.     and then C-Kermit would not send it.
  1505.  
  1506.     SET ATTRIBUTE CHARACTER-SET { ON, OFF }
  1507.         Turn the character-set attribute ON or OFF.  If ON, C-Kermit includes a
  1508.         code for the transfer character set in the A packet when sending a
  1509.         file, and when receiving a file, C-Kermit will translate from the
  1510.         character set (if any) specified in the incoming A packet into the
  1511.         current file character set (see SET FILE), if the transfer character
  1512.         set is known to C-Kermit (see SET UNKNOWN).
  1513.  
  1514.  
  1515.     SET ATTRIBUTE DATE { ON, OFF }
  1516.         If ON, C-Kermit includes the file's creation date in the A packet when
  1517.         sending a file, and stores incoming files with the creation dates (if
  1518.         any) given in the incoming A packets.  Beware: on some computers,
  1519.         incremental backups might skip over files with creation dates older
  1520.         than the most recent backup.
  1521.  
  1522.  
  1523.     SET ATTRIBUTE DISPOSITION { ON, OFF }
  1524.         The MAIL and REMOTE PRINT commands work by setting "dispositions" of
  1525.         Mail and Print in the A packet when sending a file.  SET ATTR DISP OFF
  1526.         will cause C-Kermit to ignore this and store such files on disk rather
  1527.         than mailing or printing them.
  1528.  
  1529.  
  1530.     SET ATTRIBUTE LENGTH { ON, OFF }
  1531.         When sending files, C-Kermit puts their length in the A packet, so the
  1532.         receiving system has an opportunity to check and/or allocate disk space
  1533.         in advance, and to refuse the file if there is not enough disk space.
  1534.         If you believe that files are being unjustly refused on the basis of
  1535.         length, you can SET ATTR LENGTH OFF.  When receiving files, C-Kermit
  1536.         presently ignores the length announced in the A packet.
  1537.  
  1538.  
  1539.     SET ATTRIBUTE OS-SPECIFIC { ON, OFF }
  1540.         Certain versions of Kermit convey operating-system specific file
  1541.         information in the A packet, which is primarily useful when
  1542.         transferring files between like systems, such as VMS to VMS.  If you
  1543.         find this feature is interfering with successful file transfer, SET
  1544.         ATTR OS OFF.
  1545.  
  1546.  
  1547.     SET ATTRIBUTE SYSTEM-ID { ON, OFF }
  1548.         The A packet also includes a code identifying the file's operating
  1549.         system of origin, so that the receiver of the file can decide whether
  1550.         to pay attention to the OS-SPECIFIC attribute.  Use SET ATTR SYS OFF to
  1551.         disable this feature.
  1552.  
  1553.  
  1554.     SET ATTRIBUTES ALL { ON, OFF }
  1555.         You can turn all the above off using SET ATTR ALL OFF, and back on
  1556.         using SET ATTR ALL ON.
  1557.  
  1558.  
  1559.     SET ATTRIBUTES { ON, OFF }
  1560.         This command turns the attribute mechanism itself on or off, without
  1561.         disturbing the settings of the individual attributes.  It is on by
  1562.         default.
  1563.  
  1564.  
  1565.  
  1566. SET BACKGROUND { OFF, ON }
  1567.     Use SET BACKGROUND off to make your prompts and messages appear in case
  1568.     they have disappeared because Kermit thinks it is running in the background
  1569.     (for example, if you are running it through an output filter, as in "kermit
  1570.     | vt100").  You can accomplish the same effect using the -z option on the
  1571.     command line.
  1572.  
  1573.  
  1574. SET BLOCK-CHECK {1, 2, 3}
  1575.     Determines the level of per-packet error detection.  "1" is a single-
  1576.     character 6-bit checksum, folded to include the values of all bits from
  1577.     each character.  "2" is a 2-character, 12-bit checksum.  "3" is a
  1578.     3-character, 16-bit cyclic redundancy check (CRC).  The higher the block
  1579.     check, the better the error detection and correction and the higher the
  1580.     resulting overhead.  Type 1 is most commonly used; it is supported by all
  1581.     Kermit implementations, and it has proven adequate in most circumstances.
  1582.     Types 2 or 3 should be used when transferring 8-bit data or when using long
  1583.     packets.
  1584.  
  1585.  
  1586. SET BUFFERS n1 n2
  1587.     Allows you to change the total buffer space used for sending packets (n1)
  1588.     and receiving packets (n2), if Kermit has been configured to allow dynamic
  1589.     buffer allocation.  The bigger you make them, the longer your packets can
  1590.     be, and the more window slots you can use.  To see the default values for
  1591.     your version of Kermit, type SHOW PROTOCOL.
  1592.  
  1593.  
  1594. SET CARRIER {AUTO, ON [n], OFF}
  1595.     Specifies C-Kermit's treatment of the Carrier (CD, DCD, or RLSD) RS-232
  1596.     signal on terminal device connections obtained via SET LINE:
  1597.  
  1598.     SET CARRIER ON
  1599.         Means to require carrier at all times; SET LINE will not return until
  1600.         carrier appears (handy for setting Kermit up to wait for a call to come
  1601.         in), and a fatal error will occur if carrier disappears during CONNECT
  1602.         or file transfer.  A nice side effect is that when you log out from the
  1603.         remote computer, you will be put back at C-Kermit prompt level
  1604.         automatically if the remote system drops carrier properly.  If you want
  1605.         to set a time limit on how long SET LINE will wait for carrier, you can
  1606.         include an optional number after SET CARRIER ON to specify the number
  1607.         of seconds to wait before timing out and returning to the prompt, for
  1608.         example SET CARRIER ON 30.
  1609.  
  1610.  
  1611.     SET CARRIER OFF means to ignore carrier at all times.  Useful for direct,
  1612.         nonmodem connections, or misbehaving modem connections.  Should only be
  1613.         used when necessary, because it takes away the ability of Kermit to
  1614.         automatically detect a broken phone connection.
  1615.  
  1616.  
  1617.     SET CARRIER AUTO means to require carrier during CONNECT but not at other
  1618.         times.  AUTO is the default.  SET CARRIER ON does not affect the DIAL
  1619.         command.
  1620.  
  1621.  
  1622.  
  1623. SET CASE { ON, OFF }
  1624.     Tells C-Kermit whether to pay attention to or ignore alphabetic case in
  1625.     string matching operations, including INPUT and IF.  Default is OFF, i.e.
  1626.     ignore case.
  1627.  
  1628.  
  1629. SET COMMAND BYTESIZE { 7, 8 }
  1630.     Normally, C-Kermit's command processor strips off the 8th bit of any
  1631.     character you type, in case your data connection to C-Kermit has parity.
  1632.     If there is no parity and you want to use an 8-bit international character
  1633.     set in your commands (for example, in the ECHO command, or in filenames),
  1634.     use SET COMMAND BYTESIZE 8.  The command also applies to the connection
  1635.     between your terminal (if any) and C-Kermit during terminal emulation
  1636.     (CONNECT), as opposed to the connection between C-Kermit and the remote
  1637.     host (see SET TERMINAL BYTESIZE).
  1638.  
  1639.  
  1640. SET COUNT n
  1641.     For use with counted loops.  See the section on script language
  1642.     programming.
  1643.  
  1644.  
  1645. SET DEFAULT directory
  1646.     Change default directory.  Equivalent to CD.
  1647.  
  1648.  
  1649. SET DIAL DISPLAY { ON, OFF }
  1650.     Show dialing activity on screen.
  1651.  
  1652.  
  1653. SET DIAL HANGUP { ON, OFF }
  1654.     Normally, the DIAL command will attempt to hang up the phone before dialing
  1655.     a new call.  This is done by momentarily dropping the Data Terminal Ready
  1656.     (DTR) signal on the currently selected terminal device.  Unfortunately, the
  1657.     method for doing this is ill-defined in some versions of UNIX, and in some
  1658.     cases DTR goes down and stays down, which can prevent all further
  1659.     communication between the computer and the modem.  If you find that the
  1660.     DIAL command does not work for you at all, try giving the command SET DIAL
  1661.     HANGUP OFF before giving the DIAL command.  This will prevent DIAL from
  1662.     hanging up the phone before dialing the new call.
  1663.  
  1664.  
  1665. SET DIAL INIT-STRING string
  1666.     Replace Kermit's built-in initialization string with string, which may
  1667.     contain backslash codes to represent control characters.
  1668.  
  1669.  
  1670. SET DIAL MNP-ENABLE { ON, OFF }
  1671.     Enable or disable MNP protocol negotiations by the modem.  Normally off.
  1672.     This command presently applies only to Telebit modems.
  1673.  
  1674.  
  1675. SET DIAL KERMIT-SPOOF { OFF, ON }
  1676.     Enable modem's "Kermit spoof" if it has one.
  1677.  
  1678.  
  1679. SET DIAL SPEED-MATCHING { OFF, ON }
  1680.     Tells whether the modem's interface speed is locked.  Default is OFF,
  1681.     meaning the modem changes its interface speed to match the connection
  1682.     speed, for example if you place a call at 2400 bps and it is answered at
  1683.     1200 bps.  Use ON if your modem is configured to do speed matching.
  1684.  
  1685.  
  1686. SET DIAL TIMEOUT number
  1687.     Seconds to wait for a response from the modem when dialing before giving up
  1688.     and declaring that the call could not be completed.  If you don't give this
  1689.     command, Kermit calculates its own dial timeout based on the modem type,
  1690.     length of the phone number, and transmission speed.  If that interval isn't
  1691.     long enough, use this command to specify a longer one.
  1692.  
  1693.  
  1694. SET DEBUG { ON, OFF, SESSION }
  1695.     SET DEBUG ON is equivalent to LOG DEBUG.  SET DEBUG SESSION means to
  1696.     display incoming control and 8-bit characters on the screen using special
  1697.     notation (see CONNECT).  SET DEBUG OFF turns off all debugging.
  1698.  
  1699.  
  1700. SET DELAY n
  1701.     How many seconds to wait before sending the first packet after a SEND
  1702.     command.  Used in remote mode to give you time to escape back to your local
  1703.     Kermit and issue a RECEIVE command before the first Kermit packet appears.
  1704.     Normally 5 seconds.
  1705.  
  1706.  
  1707. SET DUPLEX {FULL, HALF}
  1708.     For use during CONNECT.  Specifies which side is doing the echoing; FULL
  1709.     means the other side, HALF means C-Kermit must echo your keystrokes itself.
  1710.     Normally FULL.  Use half when communicating with IBM mainframes over
  1711.     linemode connections, and on similar half-duplex or local-echo connections.
  1712.     Synonym: SET LOCAL-ECHO {OFF, ON}.
  1713.  
  1714.  
  1715. SET ESCAPE-CHARACTER cc
  1716.     For use during CONNECT to get C-Kermit's attention.  The escape character
  1717.     acts as a prefix to an escape command, for instance to close the connection
  1718.     and return to C-Kermit or Unix command level.  The normal escape character
  1719.     is Control-Backslash (ASCII 28).  See CONNECT.
  1720.  
  1721.  
  1722. SET FILE parameter value
  1723.     Establish file-related parameters:
  1724.  
  1725.     SET FILE BYTESIZE { 7, 8 }
  1726.         Normally 8.  If 7, strip the 8th bit from file data during file
  1727.         transfer.
  1728.  
  1729.  
  1730.     SET FILE CHARACTER-SET name
  1731.         tells the encoding of the local file, ASCII by default.  The names
  1732.         DUTCH, GERMAN, FRENCH, etc, refer to 7-bit ASCII-based national
  1733.         replacement character (NRC) sets.  CP866, CYRILLIC-ISO, and
  1734.         KOI8-CYRILLIC refer to sets used in the Soviet Union and other
  1735.         countries that use the Cyrillic alphabet.  Latin-1 is the 8-bit ISO
  1736.         8859 Latin Alphabet 1.  JAPANESE-EUC, DEC-KANJI, JIS7, and SHIFT-JIS
  1737.         are Japanese Kanji sets.  Type SET FILE CHAR ? for a complete list.
  1738.         When receiving files, C-Kermit translates from the transfer character
  1739.         set specified in the most recent SET TRANSFER CHARACTER-SET command or
  1740.         else the one announced in the Attribute packet (if any) into the file
  1741.         character set.  When sending files, C-Kermit translates from the
  1742.         current file character set into the current transfer character set.
  1743.  
  1744.  
  1745.     SET FILE COLLISION action
  1746.         Tells what to do when a file arrives that has the same name as an
  1747.         existing file.  The actions are:
  1748.  
  1749.         BACKUP
  1750.             (default) Rename the old file to a new, unique name and store the
  1751.             incoming file under the name it arrived with.  The "new unique"
  1752.             name is simply a new generation on VAX/VMS.  In UNIX, a "generation
  1753.             number" appended to the filename, separated by a tilde, as in
  1754.             oofa.txt.~8~[The new name for the arriving file is of the form
  1755.             foo.~n~, where foo is the name they share and n is a "generation
  1756.             number"; if foo exists, then the new file will be called foo.~1~.
  1757.             If foo and foo.~1~ exist, the new file will be foo.~2~, and so on.
  1758.             If the new name would be longer than the maximum length for a
  1759.             filename, then characters are deleted from the end first, for
  1760.             instance, thelongestname on a system with a limit of 14 characters
  1761.             would become thelonges.~1~.] WARNING: UNIX C-Kermit presently
  1762.             offers no method of automatically limiting the number of versions
  1763.             of a file that can be created, so if too many of them pile up,
  1764.             you'll have to delete the ones you don't need by hand.  Or, because
  1765.             the version number syntax is compatible with GNU EMACS backup
  1766.             files, you can use EMACS to do this for you.
  1767.  
  1768.  
  1769.         OVERWRITE
  1770.             Overwrite (replace) the existing file.  The existing file is gone,
  1771.             destroyed.  Even if the file transfer fails or the incoming file is
  1772.             refused.  Use with caution.
  1773.  
  1774.  
  1775.         APPEND
  1776.             Append the incoming file to the end of the existing file.  This
  1777.             option is useful for adding information to a log file, but it
  1778.             should be used with caution to avoid, for example, joining two
  1779.             files of different types (like text and binary).
  1780.  
  1781.  
  1782.         DISCARD
  1783.             Refuse and/or discard the incoming file.  This option is handy for
  1784.             resuming multi-file transmissions that were broken.  Only those
  1785.             files that were not successfully transferred before will be
  1786.             accepted.
  1787.  
  1788.  
  1789.         RENAME
  1790.             Give the incoming file a unique name, like the BACKUP option,
  1791.             except that the incoming file gets the new name, rather than the
  1792.             existing file.
  1793.  
  1794.  
  1795.         UPDATE
  1796.             Accept the incoming file only if it is newer than the existing
  1797.             file.  This feature depends on the creation date field in the
  1798.             attribute packet.
  1799.  
  1800.  
  1801.  
  1802.     SET FILE DISPLAY { ON, OFF }
  1803.         Normally ON; when in local mode, display progress of file transfers on
  1804.         the screen (stdout), and watch the keyboard for interruptions.  If OFF
  1805.         (-q on command line) none of this is done, and the file transfer may
  1806.         proceed in the background oblivious to any other work concurrently done
  1807.         at the keyboard.
  1808.  
  1809.  
  1810.     SET FILE NAMES {CONVERTED, LITERAL}
  1811.         Normally CONVERTED, which means that outbound filenames have device,
  1812.         directory, and/or path specifications stripped, lowercase letters
  1813.         raised to upper, tildes and extra periods changed to X's, and an X
  1814.         inserted in front of any name that starts with period.  In VMS, the
  1815.         generation number is also stripped.  For UNIX only, incoming filenames
  1816.         have uppercase letters lowered.  LITERAL means that none of these
  1817.         conversions are done; therefore, any directory path appearing in a
  1818.         received file specification must exist and be write-accessible.  When
  1819.         literal naming is being used, the sender should not use path names in
  1820.         the file specification unless the same path exists on the target system
  1821.         and is writable.
  1822.  
  1823.  
  1824.     SET FILE RECORD-LENGTH n
  1825.         Tells the record length for fixed-format files, or the maximum record
  1826.         length for variable-format files, on systems like VAX/VMS where
  1827.         record-length is a meaningful concept.
  1828.  
  1829.  
  1830.     SET FILE TYPE {BINARY, TEXT}
  1831.         The file type is normally text, which means that conversion is done
  1832.         between the local computer's record format and Kermit's standard
  1833.         transfer format, for example between Unix newline characters and
  1834.         Kermit's carriage-return/linefeed sequences.  BINARY means to transmit
  1835.         file contents without conversion.  Binary (`-i' in command line
  1836.         notation) is necessary for binary files, and desirable in all file
  1837.         transfers between like systems to cut down on overhead.
  1838.  
  1839.  
  1840.     For VAX/VMS, these are the file type options:
  1841.  
  1842.  
  1843.     SET FILE TYPE TEXT
  1844.         Regular Text mode.  Applies to incoming files only.  When SENDing
  1845.         files, C-Kermit determines their type automatically.
  1846.  
  1847.  
  1848.     SET FILE TYPE BINARY [ { FIXED, UNDEFINED } ]
  1849.         Applies to incoming files only.  Binary mode: incoming files are stored
  1850.         with no translation or conversion.  The default record format is FIXED,
  1851.         but you can specify UNDEFINED too.
  1852.  
  1853.  
  1854.     SET FILE TYPE IMAGE
  1855.         This one applies to both incoming and outbound files.  For incoming
  1856.         files, it's just like BINARY FIXED.  For outbound files, it means just
  1857.         send the blocks of the file as they are stored on the disk, and ignore
  1858.         the file's RMS attributes.  SET FILE TYPE BLOCK is a synonym (for
  1859.         compatibility with Kermit-32).
  1860.  
  1861.  
  1862.     SET FILE WARNING { ON, OFF }
  1863.         SET FILE WARNING is an old command, somewhat misnamed.  SET FILE
  1864.         COLLISION (above) should be used instead.  SET FILE WARNING ON is
  1865.         equivalent to SET FILE COLLISION RENAME and SET FILE WARNING OFF is
  1866.         equivalent to SET FILE COLLISION OVERWRITE.
  1867.  
  1868.  
  1869.  
  1870. SET FLOW-CONTROL {DTR/CD, NONE, RTS/CTS, XON/XOFF}
  1871.     Normally XON/XOFF for full duplex flow control.  Should be set to NONE if
  1872.     the other system cannot do Xon/Xoff flow control, or if you have issued a
  1873.     SET HANDSHAKE command.  If set to XON/XOFF, then HANDSHAKE should be set to
  1874.     NONE.  This setting applies during both terminal connection and file
  1875.     transfer.  Warning: This command may have no effect on certain UNIX
  1876.     systems, where Kermit puts the communication line into "rawmode" and
  1877.     rawmode precludes flow control.
  1878.  
  1879.  
  1880.     The DTR/CD and RTS/CTS options are two kinds of "hardware flow control",
  1881.     using special wires (other than the data wires) in the connector.  These
  1882.     forms of flow control (especially RTS/CTS) are especially useful with
  1883.     high-speed modems and similar devices.  But these options are only
  1884.     available in those versions of C-Kermit whose underlying operating system
  1885.     supports them.
  1886.  
  1887.  
  1888.     Certain versions of UNIX, such as that on the NeXT, provide RTS/CTS flow
  1889.     control in a different way, namely in the device driver.  For example,
  1890.     /dev/cua is the first dialout port on the NeXT without RTS/CTS flow
  1891.     control, and /dev/cufa is the same port, but with built-in RTS/CTS flow
  1892.     control.
  1893.  
  1894.  
  1895.  
  1896.  
  1897. SET HANDSHAKE {XON, XOFF, CR, LF, BELL, ESC, NONE}
  1898.     Normally NONE.  Otherwise, half-duplex communication line turnaround
  1899.     handshaking is done during file transfer, which means C-Kermit will not
  1900.     reply to a packet until it has received the indicated handshake character
  1901.     or has timed out waiting for it; the handshake setting applies only during
  1902.     file transfer.  If you SET HANDSHAKE to other than NONE, then FLOW should
  1903.     be set to NONE.
  1904.  
  1905.  
  1906. SET HOST name
  1907.     For communicating over a network rather than a terminal device.  Presently
  1908.     supported only for Berkeley-based or other UNIX implementations using the
  1909.     socket interface to a TCP/IP network, for VAX/VMS with the TGV MultiNet
  1910.     TCP/IP package, and for SunLink X.25.  For TCP/IP networks, the name is the
  1911.     hostname or IP host number of a host on the network, optionally followed by
  1912.     a colon and an IP service number.  By default, C-Kermit connects to the
  1913.     telnet (virtual terminal server) socket on TCP/IP connections.  For X.25
  1914.     networks, the name is the X.121 address.
  1915.  
  1916.  
  1917. SET INCOMPLETE {DISCARD, KEEP}
  1918.     Disposition for incompletely received files.  If an incoming file is
  1919.     interrupted or an error occurs during transfer, the part that was received
  1920.     so far is normally discarded.  If you SET INCOMPLETE KEEP then partial
  1921.     files will be kept.
  1922.  
  1923.  
  1924. SET INPUT {CASE, ECHO, TIMEOUT-ACTION}
  1925.     Controls the behavior of the INPUT command.  See the section on script
  1926.     programming.
  1927.  
  1928.  
  1929. SET KEY n [ string ]
  1930.     Key mapping for CONNECT mode.  Tell Kermit that when you press the key
  1931.     whose code is n during CONNECT mode, it should substitute the string in its
  1932.     place.  The string is entered in the native character set of your computer,
  1933.     or you can use backslash codes.  The characters are subject to the same
  1934.     translation and shifting rules as the characters you would enter manually
  1935.     at the keyboard during CONNECT mode.  The code n must be a number between 0
  1936.     and 255 (higher numbers are possible on some computers, like OS/2, if
  1937.     Kermit knows how to read your computer's keyboard scan codes).  A key
  1938.     mapping for code n applies to all keys that produce this code, for example
  1939.     SET KEY \9 \27 assigns the code 27 (ESC) to the TAB key and to the CTRL-I
  1940.     key.  To find out a key's code, enter the SHOW KEY command, then press the
  1941.     key or key combination.  Entering the SET KEY for key n without specifying
  1942.     a string results in removing any previous key mapping for key n, i.e. n
  1943.     sends itself.  Key mappings do not apply to escape-character arguments.  If
  1944.     the escape character appears in a SET KEY string, it is treated as an
  1945.     ordinary data character, but if a key definition is exactly one character
  1946.     long, and that character is the escape character, it is treated as the
  1947.     escape character.
  1948.  
  1949.  
  1950. SET LANGUAGE {ICELANDIC, GERMAN, NORWEGIAN, RUSSIAN, ...}
  1951.     For use with international text file transfer.  If you tell Kermit what
  1952.     language a text file is written in, then Kermit might be able to apply
  1953.     certain transliteration tricks when translating between the file character
  1954.     set and the transfer character set.  See the section on international
  1955.     character sets.
  1956.  
  1957.  
  1958. SET LINE [terminal-device-name]
  1959.     The device name for the communication line to be used for file transfer and
  1960.     terminal connection, e.g. /dev/ttyi3 on a Unix system or TXA0: on a VAX/VMS
  1961.     computer.  If you specify a device name, Kermit will be in local mode, and
  1962.     you should remember to issue any other necessary SET commands, such as SET
  1963.     SPEED (on Unix, at least, the SET SPEED command is not strictly necessary
  1964.     -- Kermit will use the line's current speed, but you should use SET SPEED
  1965.     anyway, so that you be sure that speed you desire is actually being used).
  1966.  
  1967.  
  1968.     If you omit the device name, Kermit will revert to its default mode of
  1969.     operation.  If you specify the default device name (/dev/tty in Unix, TT:
  1970.     in VMS), Kermit will enter remote mode (useful when logged in through the
  1971.     "back port" of a system normally used as a local-mode workstation).
  1972.  
  1973.  
  1974.     Whenever you give a SET LINE command, C-Kermit closes any currently open
  1975.     communication device before attempting to open the new one.  Therefore SET
  1976.     LINE is also useful for closing and hanging up a dialed connection.
  1977.  
  1978.  
  1979.     When Unix Kermit enters local mode, it attempts to synchronize with other
  1980.     programs (like uucp) that use external communication lines so as to prevent
  1981.     two programs using the same line at once; before attempting to lock the
  1982.     specified line, it will close and unlock any external line that was
  1983.     previously in use.  If your system does not allow you to have write access
  1984.     to the uucp lock directory, then you will receive a message like "Sorry,
  1985.     access to lock denied."  In this case, you must ask your system
  1986.     administrator to ensure that uucp lockfiles are set up correctly and Kermit
  1987.     is installed correctly.  If Kermit were to use the external line without
  1988.     proper coordination with uucp (and even other copies of Kermit), then two
  1989.     or more users could find themselves using the same line at the same time,
  1990.     which would prevent all useful communication.
  1991.  
  1992.  
  1993.     If you SET LINE to a communication port that has a modem attached, and you
  1994.     have SET CARRIER ON, then the SET LINE command will not return until
  1995.     carrier appears on the device.  This is useful for setting up a Kermit
  1996.     program that other people can dial in to.  You can control the amount of
  1997.     time Kermit will wait for carrier using SET CARRIER ON n, where n is the
  1998.     number of seconds to wait for a connection before timing out.  You can also
  1999.     interrupt a blocked SET LINE command by typing Ctrl-C.
  2000.  
  2001.  
  2002. SET MACRO { ECHO, ERROR } { ON, OFF }
  2003.     Tells whether the individual commands that comprise a macro should be
  2004.     echoed on the screen during macro execution (normally they are not), and
  2005.     whether an error during macro execution should terminate the macro
  2006.     immediately (normally it does not).  See the section on script programming.
  2007.  
  2008.  
  2009. SET MODEM-DIALER name
  2010.     The type of modem  dialer on the communication line; the name identifies
  2011.     the modem type: DIRECT, HAYES, RACALVADIC, VENTEL, etc.  "Direct" indicates
  2012.     either there is no dialout modem, or that if the line requires carrier
  2013.     detection to open, then SET LINE will hang waiting for an incoming call.
  2014.     HAYES, VENTEL, and the others indicate that SET LINE will prepare for a
  2015.     subsequent DIAL command for the given dialer.  UNKNOWN means a modem is
  2016.     attached, but of an unknown or unsupported type.  Support for new dialers
  2017.     is added from time to time, so type SET MODEM ? for a list of those
  2018.     supported in your copy of Kermit.  Also see the description of the DIAL and
  2019.     SET DIAL commands.  NOTE: the SET MODEM command must be given before the
  2020.     SET LINE command if you plan to use the DIAL command.
  2021.  
  2022.  
  2023. SET NETWORK {TCP/IP, X.25}
  2024.     Select the type of network that is to be used for SET HOST connections.
  2025.     TCP/IP is presently available for UNIX systems that support the Berkeley
  2026.     sockets library (such as BSD-based UNIXes, HP-UX, Xenix with Excelan
  2027.     TCP/IP) and for VAX/VMS with the TGV MultiNet library.  X.25 is available
  2028.     only for SUNs with the SunLink product (see section on X.25 support).
  2029.  
  2030.  
  2031. SET PAD
  2032.     (See X.25 section)
  2033.  
  2034.  
  2035. SET PARITY {EVEN, ODD, MARK, SPACE, NONE}
  2036.     Specify character parity for use in packets and terminal connection,
  2037.     normally NONE.  If other than NONE, C-Kermit will seek to use the 8th-bit
  2038.     prefixing mechanism for transferring 8-bit data, which can be used
  2039.     successfully only if the other Kermit agrees during the automatic feature
  2040.     negotiation phase; if not, 8-bit data cannot be successfully transferred.
  2041.     In Berkeley-based Unix implementations, if you SET PARITY to other than
  2042.     NONE, this will also enable Xon/Xoff flow control during file transfer if
  2043.     FLOW is set to XON/XOFF; otherwise, flow control is not done (because the
  2044.     communication line must be opened in "raw mode" for 8-bit data, which
  2045.     precludes the use of Xon/Xoff flow control in Berkeley Unix).
  2046.  
  2047.  
  2048. SET PROMPT [text]
  2049.     The given text will be substituted for "C-Kermit>" as this program's
  2050.     prompt.  If the text is omitted, the prompt will revert to "C-Kermit>".  If
  2051.     the text is enclosed in { curly braces }, the braces are stripped and any
  2052.     leading and trailing blanks are retained.  The text may contain backslash
  2053.     codes.
  2054.  
  2055.  
  2056. SET QUIET {ON, OFF}
  2057.     Normally OFF.  Various informational messages are issued by the user
  2058.     interface.  ON suppresses these messages (but not error messages).
  2059.     Equivalent to '-q' on the command line.
  2060.  
  2061.  
  2062. SET RECEIVE parameter value
  2063.     (See SET SEND.)
  2064.  
  2065.  
  2066. SET RETRY n
  2067.     Specify the maximum number of times a particular packet can be
  2068.     retransmitted (because of timeout or transmission errors) before Kermit
  2069.     gives up and declares the file transfer a failure.
  2070.  
  2071.  
  2072. SET {SEND, RECEIVE} parameter value
  2073.     These commands are used to modify the normal formats and procedures used by
  2074.     the Kermit file transfer protocol.  Normally they are not necessary, but
  2075.     they can be used to overcome unusual obstacles, or to improve Kermit's
  2076.     performance.
  2077.  
  2078.  
  2079.     The SET RECEIVE command lets you tell the other Kermit how it should format
  2080.     the packets it sends to you.  Give SET RECEIVE commands to the Kermit that
  2081.     is going to receive files.  If you plan to transfer files in both
  2082.     directions, give SET RECEIVE commands to both Kermits.
  2083.  
  2084.  
  2085.     The SET SEND command rarely needs to be used.  It is for overriding what
  2086.     the the other Kermit requests, and should be necessary only if you cannot
  2087.     use a SET RECEIVE command to modify the parameter in question on the
  2088.     receiving Kermit.
  2089.  
  2090.     SET {RECEIVE, SEND} END-OF-PACKET cc
  2091.         Specifies the control character that marks the end of a Kermit packet.
  2092.         Normally 13 (carriage return), which most Kermit implementations
  2093.         require.
  2094.  
  2095.  
  2096.     SET {RECEIVE, SEND} PACKET-LENGTH n
  2097.         Specify the maximum packet length, normally 90.  Shorter packet lengths
  2098.         can be useful on noisy lines, or with systems or front ends or networks
  2099.         that have small buffers.  The shorter the packet, the higher the
  2100.         overhead, but the lower the chance of a packet being corrupted by
  2101.         noise, and the less time to retransmit corrupted packets.  If you
  2102.         request a length greater than 94, "long packets" are used, which is a
  2103.         feature that not all other Kermit programs support (most popular ones
  2104.         do).  C-Kermit can send and receive packets up to about 2000 characters
  2105.         in length.  If you use longer packets, you should also request a
  2106.         stronger error checking method (see SET BLOCK-CHECK).  SET SEND
  2107.         PACKET-LENGTH overrides the value requested by the other Kermit during
  2108.         protocol initiation unless the other Kermit requests a shorter length.
  2109.  
  2110.  
  2111.     SET {RECEIVE, SEND} PAD-CHARACTER cc
  2112.         SET RECEIVE PAD-CHARACTER allows C-Kermit to request the other Kermit
  2113.         to use cc as a pad character.  Default cc is NUL, ASCII 0.  C-Kermit
  2114.         normally does not need to have incoming packets preceded with pad
  2115.         characters.  SET SEND PAD-CHARACTER designates a character to send
  2116.         before each packet.  Normally, none is sent.  Outbound padding is
  2117.         sometimes necessary for communicating with slow half duplex systems
  2118.         that provide no other means of line turnaround control.  It can also be
  2119.         used to send special characters to communications equipment that needs
  2120.         to be put in "transparent" or "no echo" mode, when this can be
  2121.         accomplished in by feeding it a certain control character.
  2122.  
  2123.  
  2124.     SET {RECEIVE, SEND} PADDING n
  2125.         How many pad characters to request or send, normally 0.
  2126.  
  2127.  
  2128.     SET {RECEIVE, SEND} START-OF-PACKET cc
  2129.         The normal Kermit packet prefix is Control-A (1); this command changes
  2130.         the prefix C-Kermit puts on outbound packets.  The only reasons this
  2131.         should ever be changed would be: Some piece of equipment somewhere
  2132.         between the two Kermit programs will not pass through a Control-A; or,
  2133.         some piece of of equipment similarly placed is echoing its input.  In
  2134.         the latter case, the recipient of such an echo can change the packet
  2135.         prefix for outbound packets to be different from that of arriving
  2136.         packets, so that the echoed packets will be ignored.  The opposite
  2137.         Kermit must also be told to change the prefix for its inbound packets
  2138.         (use SET RECEIVE START on one Kermit and SET SEND START on the other).
  2139.  
  2140.  
  2141.     SET {RECEIVE, SEND} TIMEOUT n
  2142.         Normally, each Kermit partner sets its packet timeout interval based on
  2143.         what the opposite Kermit requests.  SET RECEIVE TIMEOUT allows you to
  2144.         override the normal procedure and specify a timeout interval for
  2145.         C-Kermit to use when waiting for packets from the other Kermit.  If you
  2146.         specify 0, then no timeouts will occur, and C-Kermit will wait forever
  2147.         for expected packets to arrive (relying on the other Kermit to provide
  2148.         the timeout function).  SET SEND TIMEOUT specifies the number of
  2149.         seconds to wait for a packet before timing it out and retransmitting or
  2150.         requesting retransmission.
  2151.  
  2152.  
  2153.  
  2154. SET SCRIPT ECHO {ON, OFF}
  2155.     Tell whether the SCRIPT command should echo its interactions with the
  2156.     remote host on your screen.  ON by default.
  2157.  
  2158.  
  2159. SET SERVER DISPLAY {ON, OFF}
  2160.     Specify whether C-Kermit, when in server mode, should put a file transfer
  2161.     display on the screen when it is in local mode.  Normally OFF.
  2162.  
  2163.  
  2164. SET SERVER TIMEOUT n
  2165.     Specify the time interval n in seconds for the C-Kermit server to send NAK
  2166.     packets while waiting for a command packet.  These NAKs are intended to
  2167.     break deadlocks in case a client Kermit that cannot time out sends a
  2168.     command packet which is lost.  However, the server command-wait NAKs can
  2169.     interfere with originate/answer devices that are to be used for answering.
  2170.     For example, you can run a C-Kermit server on a modem line that normally
  2171.     dials out, so that people can dial in to it and give Kermit commands.
  2172.     While waiting for the phone call to come, the server NAKs might "wake up"
  2173.     the modem and put it into originate mode, preventing the incoming call from
  2174.     being answered.
  2175.  
  2176.  
  2177. SET SESSION-LOG { BINARY, TEXT }
  2178.     Specify how the session log is to be written.  TEXT is the default, meaning
  2179.     that lines are written using the convention of the local system; for
  2180.     example, Unix session logs will have carriage returns (and certain other
  2181.     extraneous characters like NUL) omitted.  BINARY means to record all
  2182.     characters in the session log.
  2183.  
  2184.  
  2185. SET SPEED n
  2186.     The transmission speed in bits per second ("baud rate") for the
  2187.     communication line specified in SET LINE (but not SET HOST).  This command
  2188.     cannot be used to change the speed of your own console terminal.  Some
  2189.     computers are set up in such a way that you must give this command after a
  2190.     SET LINE command before you can use the line.  Type SET SPEED ? to see what
  2191.     speeds are available.  Use speeds greater than 9600 with caution, since
  2192.     they are not necessarily supported by the communication devices on your
  2193.     computer or the other computer, or the communication path between them.
  2194.  
  2195.  
  2196. SET SUSPEND { OFF, ON }
  2197.     (UNIX only) On UNIX versions that support job control, C-Kermit can
  2198.     normally be put in the background by typing the suspend character (usually
  2199.     Ctrl-\), or giving C-Kermit the SUSPEND (or Z) command, or by using the Z
  2200.     connect-mode escape.  SET SUSPEND OFF disables this feature.  This is
  2201.     useful when suspending doesn't work right (e.g. on certain UNIX
  2202.     implementations that have bugs) or when you are running Kermit under the
  2203.     Bourne shell.
  2204.  
  2205.  
  2206. SET TAKE { ECHO, ERROR } { ON, OFF }
  2207.     SET TAKE ECHO tells whether commands from a TAKE file are displayed on the
  2208.     screen as they are executed (normally they are not).  SET TAKE ERROR
  2209.     controls whether execution of a TAKE command file should be terminated if
  2210.     an error occurs (normally it is not).
  2211.  
  2212.  
  2213. SET TERMINAL parameter value
  2214.     Used for specifying terminal parameters.
  2215.  
  2216.     SET TERMINAL BYTESIZE { 7, 8 }
  2217.         tells the character size to be used on the communication line between
  2218.         the local C-Kermit and the remote Kermit during terminal emulation
  2219.         (C-Kermit CONNECT command).  It's 7 by default, which means that the
  2220.         high-order (8th) bit is stripped from each incoming and outgoing
  2221.         character.  Use 8 for 8-bit character sets like ISO Latin Alphabet 1,
  2222.         but this will work only if the connection really is 8-bits no-parity.
  2223.         Compare with SET COMMAND BYTESIZE.
  2224.  
  2225.  
  2226.     SET TERMINAL CHARACTER SET <remote-set> [ <local-set> ]
  2227.         For use during CONNECT.  Specify the character set that is being sent
  2228.         to C-Kermit by the remote computer, and specify which local character
  2229.         set to translate it into.  If the local character set is omitted, the
  2230.         current file character set is used.  The choices for the character sets
  2231.         are the same as for C-Kermit's file character sets (see SET FILE
  2232.         CHARACTER-SET).  SET TERMINAL CHARACTER-SET TRANSPARENT (which is
  2233.         Kermit's startup default) means no translation is done.  Equivalently,
  2234.         no translation is done if the local and remote sets are specified to be
  2235.         the same.  When they are different, translation goes through the Latin
  2236.         Alphabet 1 unless the local character set is Cyrillic-based in which
  2237.         case it goes through the Latin/Cyrillic Alphabet.  Kanji terminal
  2238.         character-sets are not supported.
  2239.  
  2240.  
  2241.     SET TERMINAL LOCKING-SHIFT { OFF, ON }
  2242.         Tells C-Kermit whether to use Shift-In/Shift-Out (Ctrl-O and Ctrl-N) to
  2243.         switch between 7-bit and 8-bit characters during CONNECT.  Applies to
  2244.         the Kermit-to-remote part of the connection only, and it applies to
  2245.         both the characters you type and to those Kermit receives from the
  2246.         remote.  OFF by default.
  2247.  
  2248.  
  2249.     SET TERMINAL NEWLINE { ON, OFF }
  2250.         OFF is the default.  When ON, Kermit sends CRLF whenever you type CR
  2251.         during terminal emulation.
  2252.  
  2253.  
  2254.     SET TERMINAL TYPE { VT100, TEK }
  2255.         (OS/2 C-Kermit only) Select the type of terminal to emulate.
  2256.  
  2257. Terminal parameters can be displayed with the SHOW TERMINAL command.
  2258.  
  2259.  
  2260. SET TRANSFER CHARACTER-SET name
  2261.     Tells what character set should be used for file data within Kermit packets
  2262.     during transfer of text files.  The choices are:
  2263.  
  2264.     TRANSPARENT
  2265.         Don't translate characters at all.
  2266.  
  2267.  
  2268.     ASCII
  2269.         Means to use the 7-bit ASCII (American Standard Code for Information
  2270.         Interchange) character set.  If the local file character set contains
  2271.         characters that do not occur in ASCII (like accented letters),
  2272.         represent them in ASCII the best way possible.
  2273.  
  2274.  
  2275.     CYRILLIC-ISO
  2276.         Means to use the ISO 8859-5 Latin/Cyrillic Alphabet, which is capable
  2277.         of representing Russian, Ukrainian, Bulgarian, Serbian, etc.
  2278.  
  2279.  
  2280.     LATIN1
  2281.         Means to use ISO 8859 Latin Alphabet 1, which is capable of
  2282.         representing most western European languages (English, German, Spanish,
  2283.         Dutch, Italian, Norwegian, Danish, Swedish, Portuguese, etc).
  2284.  
  2285.  
  2286.     JAPANESE-EUC
  2287.         Means to use Japanese Extended UNIX Code, which is a mixture of 7-bit
  2288.         Roman (Japanese ISO 646, similar to ASCII), single-byte Katakana, and
  2289.         double-byte JIS X 0208 Kanji.
  2290.  
  2291.  
  2292.  
  2293. SET TRANSMIT parameter value
  2294.     Controls the behavior of the TRANSMIT command, used for uploading files to
  2295.     computers that don't have Kermit programs.  See TRANSMIT.  The parameters
  2296.     are:
  2297.  
  2298.     ECHO { OFF, ON }
  2299.         Controls whether the characters that are sent to the other computer are
  2300.         also displayed on your screen.  The default is ON.
  2301.  
  2302.  
  2303.     EOF string
  2304.         String to send after sending the file, for example SET TRANSMIT EOF \4
  2305.         to send a Ctrl-D.
  2306.  
  2307.  
  2308.     FILL character
  2309.         ASCII value of character to insert into blank lines.  Some computers
  2310.         ignore blank lines, others might terminate the upload when they receive
  2311.         a blank line.  Use this command to insert a character, such as space
  2312.         (32) or X (88), in any blank line.
  2313.  
  2314.  
  2315.     LINEFEED { ON, OFF }
  2316.         Transmit linefeed as well as carriage return at the end of each line.
  2317.         Normally, only CR is sent.
  2318.  
  2319.  
  2320.     LOCKING-SHIFT { ON, OFF }
  2321.         Whether to send the locking-shift characters SO (Ctrl-N) and SI
  2322.         (Ctrl-O) around 8-bit characters when transmitting and PARITY is not
  2323.         NONE.
  2324.  
  2325.  
  2326.     PAUSE n
  2327.         Number of milliseconds (1000 milliseconds = 1 second) to pause after
  2328.         sending each line of a text file, or each character of a binary file
  2329.         (according to SET FILE TYPE).  Maximum 1000, default 0.
  2330.  
  2331.  
  2332.     PROMPT n
  2333.         ASCII value of character to look for from host before sending next
  2334.         line, normally LF (10), in text mode only; 0 means not to wait for any
  2335.         responses from the host -- just send all the characters in a steady
  2336.         stream.  This command has no effect in binary mode (i.e. when FILE TYPE
  2337.         is set to BINARY).
  2338.  
  2339. Synonym: SET XMIT.
  2340.  
  2341.  
  2342. SET UNKNOWN-CHAR-SET { DISCARD, KEEP }
  2343.     Tells what to do if a file arrives whose Attribute packet announces a
  2344.     transfer character set unknown to C-Kermit.
  2345.  
  2346.  
  2347. SET WILDCARD-EXPANSION { KERMIT, SHELL }
  2348.     (UNIX only) Tells who should expand wildcard characters in SEND and similar
  2349.     commands: KERMIT (the default) or the user's preferred Unix shell (such as
  2350.     sh, csh, or ksh).
  2351.  
  2352.  
  2353. SET WINDOW n
  2354.     Select a window size.  This refers to Kermit's sliding window packet
  2355.     transport protocol.  Normally, Kermit sends a packet, waits for the reply,
  2356.     then sends the next packet, and so on.  This is called "stop and wait"
  2357.     operation, corresponding to a window size of 1, and is supported by all
  2358.     Kermit programs.  If you select a window size greater than 1, and if the
  2359.     other Kermit supports sliding windows, then multiple packets (up to the
  2360.     window size) can be sent before any replies are required.  This allows file
  2361.     transfer to operate efficiently over connections that have long delays,
  2362.     like over public data networks or through satellites.
  2363.  
  2364.  
  2365.     With a sufficiently large window size, transmission can be continuous with
  2366.     no pauses or delays.  The maximum window size is 31, but sizes greater than
  2367.     5 or 10 are rarely necessary.
  2368.  
  2369.  
  2370.     Sliding windows may be used in conjunction with long packets, but the
  2371.     maximum length for packets decreases with increasing window size.
  2372.  
  2373.  
  2374.     Kermit uses the "selective retransmission" technique, so that if packets
  2375.     are damaged during sliding windows transfers, only the damaged packets are
  2376.     retransmitted.
  2377.  
  2378.  
  2379. SET X.25
  2380.     (See X.25 section)
  2381.  
  2382.  
  2383. The SHOW Command
  2384.  
  2385. Syntax: SHOW category
  2386.  
  2387. The SHOW command with the default argument of "parameters" displays the values
  2388. of most of the SET parameters described above.  If you type a category name
  2389. after SHOW, then a more detailed report of parameters within the named category
  2390. are displayed, for example SHOW COMMUNICATIONS, SHOW PROTOCOL.  Type SHOW ? to
  2391. see a list of the available categories.
  2392.  
  2393.  
  2394. 1.11. Backslash Notation
  2395.  
  2396. \ (backslash) in any command means that what follows is not ordinary text, but
  2397. rather a code, variable, or function whose value is to be substituted into the
  2398. command at that point.  The character after the backslash identifies which kind
  2399. of quantity this is:
  2400.  
  2401.     % A user-defined simple (scalar) variable
  2402.     & an array reference
  2403.     $ an environment variable
  2404.     v (or V) a built-in variable
  2405.     f (or F) a function
  2406.     d (or D) a decimal (base 10) number
  2407.     o (or O) an octal (base 8) number
  2408.     x (or X) a hexadecimal (base 16) number
  2409.     \ the backslash character itself
  2410.     \b
  2411.       (or \B) the BREAK signal (OUTPUT command only)
  2412.     \l
  2413.       (or \L) a Long BREAK signal (OUTPUT command only)
  2414.     a decimal digit
  2415.       a 1-3 digit decimal number.
  2416.     anything else
  2417.       The following character is taken literally.
  2418.  
  2419. Variables, arrays, functions, etc, are explained in the next section.  Numbers
  2420. can be expressed in backslash notation in the following ways:
  2421.  
  2422. \{...}
  2423.     A grouped number, braces discarded, e.g. \{17}5 is not the same as \175.
  2424.  
  2425.  
  2426. \nnn
  2427.     (1-3 decimal digits) replaced by binary number 0-255, e.g.  \13 represents
  2428.     carriage return (ASCII 13).
  2429.  
  2430.  
  2431. \dnnn or \Dnnn - Same as \nnn
  2432.  
  2433.  
  2434. \onnn or \Onnn (1-3 octal digits) replaced by binary number 0-255.
  2435.  
  2436.  
  2437. \xnn or \Xnn (2 hexadecimal digits) replaced by binary number 0-255.
  2438.  
  2439. Numbers expressed in backslash notation are typically used to express
  2440. nonprintable ASCII characters within character strings, or in commands that
  2441. want you to enter the ASCII value of a character.  Examples:
  2442.  
  2443.     echo \7Wake up!\7            ; A message with beeps
  2444.     echo \27[H\27[J              ; VT100 clear-screen sequence
  2445.     set pad-character \o177      ; The ASCII character DEL
  2446.  
  2447.  
  2448. 1.12. Macros, Variables, and Script Programming
  2449.  
  2450. C-Kermit's script programming language is based upon that of MS-DOS Kermit, and
  2451. it is in most ways upwards compatible with it, meaning that many MS-DOS Kermit
  2452. script programs (or TAKE files in general) will work in C-Kermit with little or
  2453. no modification.  C-Kermit also has a SCRIPT command that provides a terse but
  2454. cryptic shorthand for automating certain kinds of interactive operations (see
  2455. Section 1.13).
  2456.  
  2457.  
  2458. 1.12.1. Variables
  2459.  
  2460. A variable name is of the form \%i, where i is a single letter or digit.
  2461. Letter-variables are different from digit-variables, which are used as macro
  2462. parameters.  The alphabetic case of a letter-variable doesn't matter:  \%a is
  2463. the same variable as \%A.
  2464.  
  2465. All variables have character strings as values.  A variable is considered to
  2466. exist if its value is a string of at least one character in length, otherwise
  2467. it is "undefined" and does not exist.
  2468.  
  2469. A value is given to a variable using the DEFINE or ASSIGN command:
  2470.  
  2471. DEFINE name [ text ]
  2472.     The named variable (or macro, see below) is created, with text as a value.
  2473.     If a macro or variable of the given name already exists, its definition is
  2474.     replaced with the new one.  The given text is copied into the definition
  2475.     literally.  If it contains any variable names, functions references, etc,
  2476.     these are simply copied, rather than evaluated.
  2477.  
  2478.  
  2479. ASSIGN name text
  2480.     The text is evaluated, and then the named variable or macro's value is set
  2481.     to the evaluated text.  This differs from DEFINE, which does not evaluate
  2482.     the text, but rather copies it literally.  The distinction between ASSIGN
  2483.     and DEFINE doesn't matter unless the text contains variable names.  With
  2484.     ASSIGN, the contents of the variable is copied, whereas with DEFINE, the
  2485.     name of the variable is copied.
  2486.  
  2487. To illustrate the difference between DEFINE and ASSIGN:
  2488.  
  2489.     def \%a Monday
  2490.     def \%b Today is \%a
  2491.     assign \%c Today is \%a
  2492.     def \%a Tuesday
  2493.     echo \%b
  2494.     echo \%c
  2495.  
  2496. The definition of \%b is "Today is \%a", so that whenever the value of \%a
  2497. changes, so does the value of \%b.  The definition of \%c, however, is fixed as
  2498. "Today is Monday", because "Monday" was the value of \%a at the time that \%c
  2499. was assigned.
  2500.  
  2501. A variable can be used in any Kermit command simply by referring to its name:
  2502.  
  2503.     echo \%a
  2504.  
  2505. and variables can be undefined by DEFINEing or ASSIGNing nothing to them, for
  2506. example:
  2507.  
  2508.     define \%a
  2509.  
  2510. You can define variables with long names, too:
  2511.  
  2512.     define telephone-number 7654321
  2513.  
  2514. But you have to refer to them in a special way, \m(name), e.g.:
  2515.  
  2516.     echo \m(telephone-number)
  2517.  
  2518. A special kind of variable is called an array.  This is simply a list, in which
  2519. each element has a number.  An array reference looks like \&a[i].  The \& means
  2520. this is an array element rather than a simple variable, the letter tells which
  2521. array it is (a, b, c, ..., z), and the brackets enclose an index which tells
  2522. which member of the array is being referred to: 1, 2, 3, etc.  The index can be
  2523. a number, or it can be a variable or function (even another array element) that
  2524. has a numeric value.  Array indices must be (or evaluate to) zero or greater.
  2525.  
  2526. Arrays have to be declared before you can use them, so Kermit will know how big
  2527. the array is and can create storage for it.  The command is DECLARE, for
  2528. example:
  2529.  
  2530.     DECLARE \&A[100]
  2531.  
  2532. This tells Kermit to create an array called \&a with 100 elements.  Once an
  2533. array is declared, its elements can be used just like simple variables:
  2534.  
  2535.     DEFINE \&A[3] Tuesday
  2536.  
  2537. An entire array can be destroyed like this:
  2538.  
  2539.     DECLARE \&A[0]
  2540.  
  2541. If you refer to an element of an array that is not declared, the reference is
  2542. replaced by the empty string.
  2543.  
  2544. The array \&@[] is predeclared.  It contains the command line that the Kermit
  2545. program was invoked with, one word per array element.  The number of elements
  2546. in the array is given in the built-in variable \v(args) (described later).
  2547. Example:
  2548.  
  2549.     $ kermit -p e -b 3
  2550.  
  2551. Here \&@[0] is the Kermit program's file specification, like
  2552. /usr/local/bin/kermit; \&@[1] is -p, \&@[2] is e, and so on.
  2553.  
  2554. The simple variables \%a..\%z and the arrays \&a[]..\&z[] are all global, which
  2555. means they can be referenced from anywhere in your script program, including
  2556. from within a TAKE file or macro.
  2557.  
  2558. You can list the names and values of all existing global simple variables with
  2559. the SHOW GLOBALS command, and you can list the names and dimensions of all
  2560. declared arrays with SHOW ARRAYS.
  2561.  
  2562.  
  2563. 1.12.2. Macros
  2564.  
  2565. A Kermit macro is a list of one or more Kermit commands that can be referred to
  2566. by a single name.  Like variables, macros are created by the DEFINE (or ASSIGN)
  2567. command:
  2568.  
  2569.     define ibm set parity mark, set duplex half, set handsh xon
  2570.  
  2571. and unlike variables, macros do not have weird-looking names; macro names can
  2572. be ordinary words.
  2573.  
  2574. Once a macro is defined, you can execute all of its commands simply by typing
  2575. the macro's name:
  2576.  
  2577.     C-Kermit>ibm
  2578.  
  2579. If you have defined a macro that has the same name as one of Kermit's built-in
  2580. commands, you will have to insert the word DO before the name in order to
  2581. execute the macro rather than the built-in command:
  2582.  
  2583.     C-Kermit>do ibm
  2584.  
  2585. (you can also use the word DO to invoke any macro).  In these examples, "IBM"
  2586. and "DO IBM" are the macro invocations.  If you follow a macro invocation by
  2587. one or more "words" (a word is a sequence of characters delimited by spaces, or
  2588. else at the end of a line), then each of these words is assigned to a
  2589. digit-variable that is accessible to the commands within the macro definition.
  2590. These trailing "words" are called the macro parameters.  The first parameter is
  2591. assigned to \%1, the second to \%2, and so on, up to a maximum of nine.  The
  2592. variable \%0 contains the name of the macro:
  2593.  
  2594.     define demo echo \%0: \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9
  2595.     demo this is a test of macro argument passing
  2596.  
  2597. Variables that do not have corresponding parameters are undefined (empty).  The
  2598. number of arguments passed to the macro is available in the named variable
  2599. \v(argc)(which, for compatibility with MS-DOS Kermit, may also be referred to
  2600. simply as ARGC, but only within IF conditions.)  Macro parameters are local to
  2601. the macro they are passed to.  If macro A invokes macro B, macro B gets its own
  2602. set of parameters, which are separate from macro A's, so that macro A still has
  2603. its own parameters available after macro B has completed.  The variables
  2604. \%0..\%9 may be used as global variables at "top level", when no macros are
  2605. active, by assigning values to them in the normal way.  To demonstrate:
  2606.  
  2607.     define xx echo \%1, yy Sneezy, echo \%1
  2608.     define yy echo \%1, zz Grumpy, echo \%1
  2609.     define zz echo \%1
  2610.     xx Sleepy
  2611.  
  2612. Try this, and you'll see how the value of \%1 is saved and restored at each
  2613. level.
  2614.  
  2615. Macro parameter words may be grouped into single parameters by enclosing them
  2616. in braces.  Try the following example to see how this works:
  2617.  
  2618.     define msg echo \%0: \%1
  2619.     msg this is another test of macro argument passing
  2620.     msg {this is yet another test of macro argument passing}
  2621.  
  2622. You can have a macro list its arguments on your screen by including the command
  2623. SHOW ARGUMENTS within the macro definition.
  2624.  
  2625. You can list the names and definitions of all existing macros with the SHOW
  2626. MACROS command.  If you include a name, as in "SHOW MACROS FOO", it will list
  2627. the definition(s) of only those macros whose names start with the character(s)
  2628. you have specified.
  2629.  
  2630. If you define a macro named ON_EXIT, it will be executed automatically when the
  2631. Kermit program exits.
  2632.  
  2633.  
  2634. 1.12.3. Named Variables
  2635.  
  2636. Built-in named variables are read-only, you cannot change them.  Their names
  2637. are of the form \v(name), in which the v can be lower or uppercase, and the
  2638. parentheses are required around the variable name.  If you refer to a named
  2639. variable that does not exist, it will be evaluated as the empty (zero-length)
  2640. string.  C-Kermit's variables are:
  2641.  
  2642.     \v(argc)
  2643.         number of arguments passed to currently active macro.
  2644.  
  2645.  
  2646.     \v(args)
  2647.         number of arguments passed to the program on the command line.  The
  2648.         program argument vector is assigned to the array \&@[].
  2649.  
  2650.  
  2651.     \v(count)
  2652.         current value of COUNT (loop control via SET COUNT, IF COUNT).
  2653.  
  2654.  
  2655.     \v(cpu)
  2656.         CPU hardware type, if known, otherwise "unknown".
  2657.  
  2658.  
  2659.     \v(date)
  2660.         current date in dd mmm yyyy format (e.g. 8 Feb 1990 or 10 Nov 1990)
  2661.  
  2662.  
  2663.     \v(directory)
  2664.         current device and/or directory.
  2665.  
  2666.  
  2667.     \v(filespec)
  2668.         file specification from most recent SEND, MSEND, or GET command, or the
  2669.         name of the file most recently received.
  2670.  
  2671.  
  2672.     \v(fsize)
  2673.         size of last file transferred.
  2674.  
  2675.  
  2676.     \v(home)
  2677.         user's home (login) directory name.
  2678.  
  2679.  
  2680.     \v(host)
  2681.         computer hostname.
  2682.  
  2683.  
  2684.     \v(input)
  2685.         current INPUT buffer contents.
  2686.  
  2687.  
  2688.     \v(line)
  2689.         current communication device or network host.
  2690.  
  2691.  
  2692.     \v(ndate)
  2693.         current date in numeric format, e.g. 19901225.
  2694.  
  2695.  
  2696.     \v(ntime)
  2697.         current time in seconds since midnight, 0 through 86399.
  2698.  
  2699.  
  2700.     \v(platform)
  2701.         name specific machine or environment C-Kermit was built for.
  2702.  
  2703.  
  2704.     \v(return)
  2705.         Value of most recent RETURN command.
  2706.  
  2707.  
  2708.     \v(speed)
  2709.         Transmission speed of current communication device, if known.  (A
  2710.         spurious value of 38400 might be reported for pseudoterminals.)
  2711.  
  2712.  
  2713.     \v(status)
  2714.         0 if the previous command succeeded, nonzero if it failed.
  2715.  
  2716.  
  2717.     \v(system)
  2718.         name of generic operating system C-Kermit was built for, such as UNIX
  2719.         or VMS.
  2720.  
  2721.  
  2722.     \v(tfsize)
  2723.         total size of all files in the last group of files that was
  2724.         transferred.
  2725.  
  2726.  
  2727.     \v(time)
  2728.         current time in hh:mm:ss 24-hour clock format (e.g. 13:45:23).
  2729.  
  2730.  
  2731.     \v(ttyfd)
  2732.         file descriptor of communication device (UNIX only).
  2733.  
  2734.  
  2735.     \v(version)
  2736.         numeric version number of C-Kermit.
  2737.  
  2738. You can use these variables in any Kermit command where their values would make
  2739. sense:
  2740.  
  2741.     echo It is \v(time) o'clock on \v(date)
  2742.  
  2743. A \v-variable's name can be abbreviated, as long as the abbreviation is enough
  2744. to distinguish it from all the other built-in variable names:  \v(dir),
  2745. \v(ver), etc.
  2746.  
  2747. You can get a listing of Kermit's built-in variables and their values with the
  2748. SHOW VARIABLES command.
  2749.  
  2750.  
  2751. 1.12.4. Built-in Functions
  2752.  
  2753. Built-in functions are of the form \fname(args).  The F and the name can be
  2754. upper or lower case.  The args are a comma-separated list of arguments.  The
  2755. function reference is replaced by its value.  For example:
  2756.  
  2757.     define \%a ABC123XYZ
  2758.     define \%b ...\Flower(\%a)...
  2759.  
  2760. results in a value of ...abc123xyz... for \%b.
  2761.  
  2762. The names of built-in functions and variables can be abbreviated to their
  2763. minimum unique length, for example \feval(1+1), \v(dir), etc.  C-Kermit's
  2764. functions include string-oriented functions that return a string:
  2765.  
  2766.     \Fliteral(arg)
  2767.         Copies its argument literally, without any evaluation.
  2768.  
  2769.  
  2770.     \Fcharacter(arg)
  2771.         Returns the single character corresponding to its argument, which must
  2772.         be numeric.  For example, \fchar(65) is 'A', \fchar(193) is A-acute (in
  2773.         the Latin-1).  If you give a negative number or a number larger than
  2774.         255, only the low-order 8 bits are used.
  2775.  
  2776.  
  2777.     \Fsubstr(arg1,arg2,arg3)
  2778.         Substring of the string arg1 starting at position arg2, of length arg3.
  2779.         arg2 and arg3 must be numbers or variables that have numeric values.
  2780.         Example:
  2781.  
  2782.             echo \fsubst(hello there,7,5)
  2783.  
  2784.         extracts the word "there".  The following is equivalent:
  2785.  
  2786.             define \%a hello there
  2787.             define \%b 7
  2788.             define \%c 5
  2789.             echo \fsubst(\%a,\%b,\%c)
  2790.  
  2791.  
  2792.  
  2793.     \Flower(arg)
  2794.         Converts all uppercase letters in its argument to lowercase, for
  2795.         example:
  2796.  
  2797.             define \%a FINE
  2798.             echo This is a \flower(\%a Mess).
  2799.  
  2800.         prints "This is a fine mess."
  2801.  
  2802.  
  2803.     \Fupper(arg)
  2804.         Converts all lowercase letters in its argument to uppercase.
  2805.  
  2806.  
  2807.     \Freverse(arg)
  2808.         Reverses the order of the characters in its argument, for example
  2809.         \frev(mupeen) is neepum.
  2810.  
  2811.  
  2812.     \Frepeat(arg1,arg2)
  2813.         Repeats the first argument the number of times given by the second
  2814.         argument, for example:
  2815.  
  2816.             echo +\frep(-+,10)
  2817.  
  2818.         produces +-+-+-+-+-+-+-+-+-+-+.
  2819.  
  2820.  
  2821.     \Flpad(text,n,c)
  2822.         Left-pads the text out to length n with character c.  If c is omitted,
  2823.         blank (space) is used.
  2824.  
  2825.  
  2826.     \Frpad(text,n,c)
  2827.         Right-pads the text out to length n with character c.  If c is omitted,
  2828.         blank (space) is used.
  2829.  
  2830.  
  2831.     \Fexecute(macroname macro-args)
  2832.         Execute the named macro with the given parameters (if any), return the
  2833.         macro's RETURN value if any (see RETURN).
  2834.  
  2835.  
  2836.     \Fcontents(variable-name)
  2837.         Returns the current definition (contents) of a variable.  If the
  2838.         definition includes variable names or function references, these are
  2839.         copied literally, without evaluation.
  2840.  
  2841.  
  2842.     \Fdefinition(macro-name)
  2843.         Returns the literal definition of the named macro.
  2844.  
  2845. Here are the string functions that return a number:
  2846.  
  2847.     \Flength(arg)
  2848.         Returns the length of the argument string.
  2849.  
  2850.  
  2851.     \Findex(arg1,arg2,arg3)
  2852.         Returns the position of the first occurrence string arg1 in string
  2853.         arg2, starting at position arg3.  If arg3 is omitted, then starting at
  2854.         the beginning.
  2855.  
  2856. File functions:
  2857.  
  2858.     \Ffiles(filespec)
  2859.         Returns the number of files that match the given file specification,
  2860.         for example \ffiles(ck*.c).
  2861.  
  2862.  
  2863.     \Fnextfile()
  2864.         Returns the next filename that matches the \Ffiles() file
  2865.         specification.  Use this in a counted loop (see below) after executing
  2866.         \Ffiles().
  2867.  
  2868. Integer arithmetic functions:
  2869.  
  2870.     \Fmax(arg1,arg2)
  2871.         Returns the maximum of its two numeric arguments.
  2872.  
  2873.  
  2874.     \Fmin(arg1,arg2)
  2875.         Returns the minimum of its two numeric arguments.
  2876.  
  2877.  
  2878.     \Feval(expression)
  2879.         Evaluates the given arithmetic expression.  The operands of the
  2880.         expression can be numeric strings or variables, or functions that
  2881.         evaluate to numeric strings.  The precedence is the normal, intuitive
  2882.         algebraic (or programming) precedence, and can be altered by the use of
  2883.         parentheses, which have higher precedence than any other operator.
  2884.         Spaces may be used to separate operators from operands, but they are
  2885.         not required.
  2886.  
  2887. Table 1-1 shows the types of expressions accepted by \feval().
  2888.  
  2889. -------------------------------------------------------------------------------
  2890.  
  2891.  
  2892.     Operator  Fix   Precedence   Operation          Example
  2893.  
  2894.      (   )              1         Group             (\%a + 3) * (\%1-5)
  2895.        !      Post      2         Factorial         \%x! - (\%x-2)!
  2896.  
  2897.        ~      Pre       3         Logical NOT       ~\%n
  2898.        -      Pre       3         Negative          -\%n
  2899.  
  2900.        ^      In        4         Raise to power    2^\%p
  2901.  
  2902.        *      In        5         Multiply          \%c * 5
  2903.        /      In        5         Divide            \%c / 5
  2904.        %      In        5         Modulus           \%c % 5
  2905.        &      In        5         Logical AND       \%c & 5
  2906.  
  2907.        +      In        6         Add               \%t + \%u
  2908.        -      In        6         Subtract          27 - \%x
  2909.        |      In        6         Logical OR        \%z | 4
  2910.        #      In        6         Exclusive OR      \%z # 4
  2911.        @      In        6         Greatest Common   \%z @ 30
  2912.                                   Divisor
  2913.  
  2914.                    Table 1-1:  \feval() Arithmetic Functions
  2915.  
  2916. -------------------------------------------------------------------------------
  2917.  
  2918. You can list the names of Kermit's built-in functions with the SHOW FUNCTIONS
  2919. command.
  2920.  
  2921. Two Kermit commands are also available to perform simple arithmetic on
  2922. variables:
  2923.  
  2924. INCREMENT name [value]
  2925.     Add value to the named variable.  If value is omitted, add 1.  If the
  2926.     variable does not have a numeric value, this command has no effect.
  2927.     Examples: inc \%a, incr \%b 10.
  2928.  
  2929.  
  2930. DECREMENT name [value]
  2931.     Subtract value from the named variable.  If value is omitted, subtract 1.
  2932.     If the variable does not have a numeric value, this command has no effect.
  2933.  
  2934.  
  2935. 1.12.5. Script Programming
  2936.  
  2937. Kermit's script programming language lets you write procedures, or programs,
  2938. that can include any Kermit command.  Variables and functions can be referenced
  2939. at practically any point in any command.  Control structures are provided for
  2940. decision making, transfer of control, looping, scoping of variables, and so
  2941. forth.  A script program can be a TAKE file, a macro, or any combination of the
  2942. two.
  2943.  
  2944. The basic idea of a script program is to automate tasks that you would normally
  2945. do "by hand" when interacting with another computer: dialing the modem,
  2946. negotiating through network boxes and front ends, logging in, etc etc.  You can
  2947. also write programs to manage local files, or to do anything that you could do
  2948. manually with Kermit.
  2949.  
  2950. To automate interaction with another computer, you need a replacement for the
  2951. CONNECT command.  This comes in two parts, an OUTPUT command that "types" what
  2952. you would type during CONNECT, and an INPUT command that reads the other
  2953. computer's responses, plus a couple related commands:
  2954.  
  2955. OUTPUT text
  2956.     Send the text to the other computer.  The text can be any combination of
  2957.     plain ordinary characters, backslash codes, variables, and functions.  To
  2958.     send a BREAK signal, include \\B in the OUTPUT string.  To send a Long
  2959.     BREAK signal, include \\L in the OUTPUT string.
  2960.  
  2961. INPUT timeout text
  2962.     Read responses from the other computer.  Wait up to timeout seconds for the
  2963.     specified text to appear.  If the text appears within the timeout interval,
  2964.     the command succeeds immediately.  Otherwise it fails.  The text can
  2965.     contain any combination of ordinary characters, backslash codes, variables,
  2966.     and functions.  If you want to include leading and/or trailing blanks in
  2967.     the INPUT text, surround it with braces, as in:
  2968.  
  2969.         input 10 {login: }
  2970.  
  2971.     INPUT can be interrupted with Ctrl-C, in which case it fails.
  2972.  
  2973. REINPUT timeout text
  2974.     Searches previous responses from the computer for the given text.  The
  2975.     timeout parameter is ignored.  The previous responses are stored in the
  2976.     INPUT buffer, which is 256 characters long, and which may also be accessed
  2977.     via the \v(input) variable.
  2978.  
  2979. ECHO [ text ]
  2980.     Display the text on the local screen, followed by a newline.  The text can
  2981.     contain any combination of backslash codes, variables, functions, etc.
  2982.  
  2983. CLEAR
  2984.     Clear any as-yet-unread characters from the communication device's input
  2985.     buffer.
  2986.  
  2987. PAUSE [ n ]
  2988.     Do nothing for the indicated number of seconds.  If a number is not given,
  2989.     pause for 1 second.  If anything is typed on the keyboard during the pause
  2990.     interval, "wake up".  PAUSE can be interrupted by typing Ctrl-C (or any
  2991.     other character), in which case it fails.
  2992.  
  2993. WAIT [ n [ { CD, CTS, DSR } ] ]
  2994.     Wait up to n seconds for the specified modem signals to appear on the
  2995.     currently selected communication device.  If you don't include any modem
  2996.     signal names, WAIT is equivalent to PAUSE.  If you include one or more
  2997.     signal names (separated by spaces), Kermit will wait for all of the
  2998.     specified signals to appear.  If they don't appear within the alloted time,
  2999.     or if the device does not have modem control, then the command will fail.
  3000.     You may interrupt the WAIT command by typing any character at the keyboard,
  3001.     in which case the command will fail.  The command will also fail if
  3002.     modem-signal support is not included in C-Kermit for your particular
  3003.     operating system version.  The modem signals are: CD (carrier detect), CTS
  3004.     (Clear To Send), and DSR (Data Set Ready).
  3005.  
  3006. Example:
  3007.  
  3008.     wait 10 cd dsr      ; Wait 5 seconds for CD and DSR.
  3009.     if success goto ok  ; Test the result.
  3010.  
  3011. WAIT can be interrupted by typing Ctrl-C (or any other character), in which
  3012. case it fails.
  3013.  
  3014. The behavior of the INPUT command can be controlled by SET INPUT:
  3015.  
  3016. SET [ INPUT ] CASE {IGNORE, OBSERVE}
  3017.     Tells whether alphabetic case matters when searching the remote computer's
  3018.     responses for the INPUT text.  This setting also affects C-Kermit's other
  3019.     string comparison operations, including IF EQUAL, IF LGT, etc (IF command
  3020.     described later).
  3021.  
  3022. SET INPUT ECHO { ON, OFF }
  3023.     Tells whether the characters read by the INPUT command should be echoed on
  3024.     the screen.
  3025.  
  3026. SET INPUT TIMEOUT-ACTION { PROCEED, QUIT }
  3027.     Tells whether the script program should continue or stop immediately if an
  3028.     INPUT command fails.
  3029.  
  3030. At this point Kermit needs a decision making mechanism to tell whether the
  3031. INPUT command succeeded or failed.  This is the IF command.  Note that IF can
  3032. be used after INPUT only if you SET INPUT TIMEOUT PROCEED.
  3033.  
  3034. IF [NOT] condition command
  3035.     If the condition is satisfied, execute the following Kermit command.  If
  3036.     the word NOT is included, execute the command if the condition is not
  3037.     satisfied.  Only one command may be given, and it must appear on the same
  3038.     line as the IF.
  3039.  
  3040. The IF command supports a wide variety of conditions.  These are:
  3041.  
  3042.     IF SUCCESS
  3043.         The previous command succeeded.
  3044.  
  3045.  
  3046.     IF FAILURE
  3047.         The previous command failed.
  3048.  
  3049.  
  3050.     IF DEFINED name
  3051.         The named variable or macro is defined.
  3052.  
  3053.  
  3054.     IF BACKGROUND
  3055.         Kermit is running in the background or with its standard input and
  3056.         output redirected.
  3057.  
  3058.  
  3059.     IF COUNT
  3060.         Subtract one from COUNT, execute the command if the result is greater
  3061.         than zero (see SET COUNT).
  3062.  
  3063.  
  3064.     IF EXIST filename
  3065.         The named file exists.
  3066.  
  3067.  
  3068.     IF NUMERIC variable
  3069.         The variable's value is numeric.
  3070.  
  3071.  
  3072.     IF EQUAL s1 s2
  3073.         s1 and s2 (character strings or variables) are equal.
  3074.  
  3075.  
  3076.     IF LLT s1 s2
  3077.         s1 is lexically (alphabetically) less than s2.  Use IF NOT LGT for
  3078.         less-than-or-equal.
  3079.  
  3080.  
  3081.     IF LGT s1 s1
  3082.         s1 is lexically (alphabetically) greater than s2.  Use IF NOT LLT for
  3083.         greater-than-or-equal.
  3084.  
  3085.  
  3086.     IF = n1 n2
  3087.         n1 and n2 (numbers or variables containing numbers) are equal.
  3088.  
  3089.  
  3090.     IF < n1 n2
  3091.         n1 is arithmetically less than n2. Use IF NOT > for less-than-or-equal.
  3092.  
  3093.  
  3094.     IF > n1 n2
  3095.         n1 is arithmetically greater than n2\n.  Use IF NOT < for greater-than-
  3096.         or-equal.
  3097.  
  3098. String comparisons in IF EQUAL, IF LGT, and IF LLT treat alphabetic case
  3099. according to SET INPUT CASE {IGNORE, OBSERVE}.  You can also use \fupper() and
  3100. \flower() to force caseless comparisons if INPUT CASE is set to OBSERVE.
  3101.  
  3102. Arithmetic comparisons work with numeric constants, variables and array
  3103. elements that evaluate to a numeric string, functions that return a numeric
  3104. value, and the special "MS-DOS Kermit compatibility" variables COUNT, VERSION,
  3105. and ARGC, which can only appear in this context.  Numeric strings are converted
  3106. to binary integers before comparison, and may be positive, zero, or negative.
  3107. Floating point ("real") numbers are not supported.
  3108.  
  3109. The IF command may be followed on the next line by an ELSE command, which is
  3110. executed if the IF condition is not true, and which is not executed if the IF
  3111. condition is true.  Example:
  3112.  
  3113.     IF < \%x 10 ECHO It's less
  3114.     ELSE echo It's not less
  3115.  
  3116. As in any programming language, it is desirable to be able to go to different
  3117. places in the program based on the decisions made by IF commands.  The command
  3118. for going-to is:
  3119.  
  3120. GOTO label
  3121.     Go to the command which follows the named label.
  3122.  
  3123. A label is a word beginning with a colon (:) on the left margin.  Example:
  3124.  
  3125.     IF < \%x 10 goto less
  3126.     echo It's not less
  3127.     goto fin
  3128.     :less
  3129.     ECHO It's less
  3130.     :fin
  3131.  
  3132. Several other commands are especially useful in conditional contexts, i.e. as
  3133. objects of IF commands:
  3134.  
  3135. STOP
  3136.     Stop executing the current script program (TAKE file or macro) and return
  3137.     immediately to C-Kermit prompt level (or, if Kermit was invoked with
  3138.     command-line action arguments, exit C-Kermit altogether).
  3139.  
  3140. END [ n ]
  3141.     Go "up" one command level.  Exit the currently executing macro or TAKE
  3142.     file, and return to the invoking TAKE file or macro.  Or, if the current
  3143.     TAKE file or macro was invoked from C-Kermit> prompt level, return to the
  3144.     prompt.  Or, if Kermit was invoked with command-line action arguments, exit
  3145.     C-Kermit.  If a value is given, it is used to set the SUCCESS flag (if the
  3146.     value is zero) or the FAILURE flag (if the value is nonzero).  You can use
  3147.     POP as a synonym for this command.
  3148.  
  3149. RETURN [value]
  3150.     For use within macros.  Just like END, except that a return value may be
  3151.     set.  This is for use with the \fexecute() function, which allows you to
  3152.     write user-defined functions.  For example:
  3153.  
  3154.         def sum if = \%1 1 return 1,-
  3155.           else return \feval(\%1 + \fexecute(sum \feval(\%1 - 1)))
  3156.  
  3157.     This function, called SUM, returns the sum of all the numbers from 1 to
  3158.     whatever number (1 or greater) it was called with, for example:
  3159.  
  3160.         echo \fexec(sum 5)
  3161.  
  3162.     prints the number 15.  Notice that this function calls itself; C-Kermit
  3163.     functions are allowed to do this.
  3164.  
  3165. Although the object command of an IF or ELSE statement may only be a single
  3166. command, that command is allowed to be a macro invocation or a TAKE command.
  3167. This provides a kind of statement grouping that can be used to avoid a lot of
  3168. confusing GOTOs.  A more flexible kind of statement grouping is available in
  3169. the XIF ("extended IF") command:
  3170.  
  3171. XIF condition { command-list } [ ELSE { command-list } ]
  3172.     In this extended form, braces are required to enclose a comma-separated
  3173.     list of one or more commands, and the ELSE clause is on the same line as
  3174.     the XIF.  Example:
  3175.  
  3176.         xif < \%x 10 {ech Less,def \%m 10} else {ec Not less,def \%m \%x}
  3177.  
  3178.     Here the appropriate message is echoed, depending on the value of \%x, and
  3179.     the minimum of \%x and 10 is assigned to the variable \%m.  Commands like
  3180.     this one can be broken onto multiple lines for clarity, but only if you use
  3181.     dash (or backslash) for line continuation:
  3182.  
  3183.         xif < \%x 10 { -
  3184.             echo Less, -
  3185.             def \%m 10 -
  3186.         } else { -
  3187.             echo Not less, -
  3188.             def \%m \%x -
  3189.         }
  3190.  
  3191. WARNING: RETURN or END statements should not be used within an XIF command.
  3192.  
  3193.  
  3194. Other Ways of Assigning Values to Variables
  3195.  
  3196. Sometimes it is desirable for a script program to interact with you as well as
  3197. with the remote computer.  For example, you should not store passwords on disk,
  3198. so you can't write script programs that contain them.  However, you can write
  3199. script programs that prompt you for your password.  This is done using the ASK
  3200. or ASKQ command:
  3201.  
  3202. ASK name prompt
  3203.     Print the prompt on the screen and wait for you to type a line of text
  3204.     (terminated by carriage return), and assign this line of text to the named
  3205.     variable (but without the carriage return), for example:
  3206.  
  3207.         ask \%p Password:
  3208.         output \%p\13
  3209.  
  3210.     The prompt may be enclosed in { curly braces } to retain leading and/or
  3211.     trailing spaces.
  3212.  
  3213. ASKQ name prompt
  3214.     Just like ASK, but it "asks quietly".  The characters you type do not echo.
  3215.     Especially useful for passwords.
  3216.  
  3217. GETOK text
  3218. Asks a "yes or no" question.  The text is the question.  Enclose it in curly
  3219. braces to preserve leading or trailing spaces.  If the user replies "Yes" or
  3220. "OK" (or any abbreviation of these), the SUCCESS flag is set (for IF SUCCESS).
  3221. If she replies "N" or "No", the FAILURE flag is set.
  3222.  
  3223. Now, with IF, branching, ASK, and so forth, we can add to our login script:
  3224.  
  3225.     define error echo Error: \%1, end   ; Error-handling macro.
  3226.     set input timeout proceed           ; Don't quit if INPUT fails.
  3227.     set input case ignore               ; Alphabetic case doesn't matter.
  3228.     set input echo off                  ; Don't need to watch.
  3229.     output \13                          ; Send carriage return (ASCII 13).
  3230.     input 5 login:                      ; Wait 5 secs for "login:" prompt.
  3231.     if fail error {No login prompt}     ; Give up if it doesn't come.
  3232.     output myuserid\13                  ; Send user ID followed by CR.
  3233.     input 5 password:                   ; Wait for password prompt.
  3234.     if fail error {No password prompt}  ; Give up if it doesn't come.
  3235.     ask \%p Password:                   ; Prompt user for password
  3236.     output \%p\13                       ; Send it, followed by CR
  3237.     input 30 $\32                       ; Wait for system prompt "$ "
  3238.     if fail error {No system prompt}    ; Give up if it doesn't come.
  3239.     connect                             ; Got it, connect.
  3240.  
  3241.  
  3242. Reading and Writing Local Files
  3243.  
  3244. It is also possible to assign data from local files to variables.  In fact,
  3245. C-Kermit includes an entire input and output system for local files and
  3246. commands:
  3247.  
  3248. OPEN mode filename
  3249.     For use with READ and WRITE commands.  Open the local file in the specified
  3250.     mode: READ, WRITE, or APPEND.  !READ and !WRITE mean to read from or write
  3251.     to a system command rather than a file.  Examples:
  3252.  
  3253.         OPEN READ oofa.txt
  3254.         OPEN !READ ls ck[uwc].[cwh]
  3255.  
  3256.     The first example reads lines from the file oofa.txt.  The second reads
  3257.     filenames from a Unix directory listing; this gives you a way to select
  3258.     files using your Unix shell's filename-matching metacharacters, which are
  3259.     more powerful than Kermit's built-in ones.
  3260.  
  3261. READ name
  3262.     The next line from the current OPEN READ or OPEN !READ file is assigned to
  3263.     the named variable, for example READ \%A.  If no more lines remain in the
  3264.     file, the command fails.
  3265. WRITE name text
  3266.     Writes the given text to the named log or file.  The text text may include
  3267.     backslash codes, and is not terminated by a newline unless you include the
  3268.     appropriate code.  The name parameter can be any of the following:
  3269.  
  3270.     DEBUG-LOG
  3271.     FILE (the OPEN WRITE, OPEN !WRITE, or OPEN APPEND file).
  3272.     PACKET-LOG
  3273.     SCREEN (just like ECHO except that WRITE does not supply a line terminator)
  3274.     SESSION-LOG
  3275.     TRANSACTION-LOG
  3276.  
  3277. CLOSE name
  3278.     Closes the named file.  A READ or !READ file is closed automatically when
  3279.     end-of-file (EOF) is encountered during a READ operation, but it does no
  3280.     harm to close it again.  WRITE, !WRITE, and APPEND files must be closed
  3281.     explicitly.  Examples: CLOSE READ, CLOSE WRITE.
  3282.  
  3283. A typical script program for reading and writing files might look like this:
  3284.  
  3285.     set take error off                  ; So EOF can be handled.
  3286.     open read foo                       ; Open input file "foo".
  3287.     open write bar                      ; Open output file "bar".
  3288.     def \%c 0                           ; Make a line counter.
  3289.     :loop                               ; Loop to read all lines.
  3290.     read \%a                            ; Read one line into \%a.
  3291.     if fail goto done                   ; Catch EOF this way.
  3292.     increment \%c                       ; Count the line.
  3293.     write file \%c. \fupp(\%a)\10       ; Format and write it.
  3294.     goto loop                           ; Go back and get more.
  3295.     :done
  3296.     close read                          ; Finished,
  3297.     close write                         ; close the files.
  3298.     echo All done.                      ; Print a message.
  3299.  
  3300. The previous example shows a loop, which is a common programming construct.  It
  3301. is always desirable to avoid infinite loops.  The READ example does this by
  3302. testing for end of file (EOF) with IF FAILURE.
  3303.  
  3304.  
  3305. Counted Loops
  3306.  
  3307. Kermit also provides for "finite", or counted, loops, in several varieties:
  3308.  
  3309. SET COUNT / IF COUNT
  3310.     Here a special variable, COUNT, is set.  The IF COUNT command decrements
  3311.     the count variable, and if the result is greater than zero, executes the
  3312.     object command:
  3313.  
  3314.         set count 5
  3315.         :loop
  3316.         echo \v(count)
  3317.         if count goto loop
  3318.         else echo Zero!
  3319.  
  3320. FOR variable iv fv step { command, command, ... }
  3321.     The FOR loop is controlled by a loop variable which is assigned an initial
  3322.     value (iv), gets tested against a final value (fv), and gets incremented by
  3323.     a step value.  If the step value is positive, the loop exits when the loop
  3324.     variable is greater than the final value.  If the step is negative, the
  3325.     loop exits when the variable becomes less than the final value.  Example
  3326.     (cute way to print the 9's times table):
  3327.  
  3328.         for \%i 0 9 1 { assign \%j \feval(9-\%i), echo \%i\%j }
  3329.  
  3330.     FOR loops can be nested:
  3331.  
  3332.         for \%i 1 5 1 { for \%j 5 \%i -1 { echo \%i:\%j } }
  3333.  
  3334. WHILE condition { command, command, ... }
  3335.     The commands are executed as long as the condition is true.  The conditions
  3336.     are the same as for the IF command.  Example:
  3337.  
  3338.         while not exist foo.bar { sleep 1 }
  3339.  
  3340.     This loop waits until file named foo.bar appears.
  3341.  
  3342. FOR and WHILE loops can be nested in any combination.  Both FOR and WHILE loops
  3343. may be exited or continued prematurely using the following commands:
  3344.  
  3345. BREAK
  3346.     Exit from the closest enclosing FOR or WHILE loop.
  3347.  
  3348. CONTINUE
  3349.     Begin the next iteration (if any) of the closest enclosing FOR or WHILE
  3350.     loop immediately.
  3351.  
  3352. WARNING: RETURN and END commands should not be used in the object commands of
  3353. FOR, WHILE, or XIF.
  3354.  
  3355. Here's a script program example that has nothing to do with data communication
  3356. or file transfer, but which illustrates the control structures of the script
  3357. language, the use of arrays, statement grouping, file i/o, etc:
  3358.  
  3359.     ; Kermit script program to read a file of numbers into an array,
  3360.     ; sort the array numerically, and display the sorted result.
  3361.     ;
  3362.     def \%d 100                   ; Allow up to 100 elements.
  3363.     dcl &a[\%d]                   ; Declare a 100-element array.
  3364.     set take error off            ; To handle EOF on READ.
  3365.     open read numbers.dat         ; Open this file for reading.
  3366.  
  3367.     ; Read each line into a separate array element
  3368.     ;
  3369.     echo Reading...
  3370.     for \%n 1 \%d 1 { -
  3371.         read \&a[\%n], -
  3372.         if fail break -
  3373.     }
  3374.     decr \%n                      ; Subtract one for read that failed.
  3375.                                   ; Check for too many lines.
  3376.     xif > \%n \%d { -
  3377.         echo Too many lines in file, -
  3378.         stop -
  3379.     }
  3380.     echo Array initialized: \%n elements, sorting...
  3381.  
  3382.     ; Sort the array using the (slow) "bubble sort" algorithm.
  3383.     ;
  3384.     assign \%m \feval(\%n-1)
  3385.     for \%i 1 \%m 1 { -
  3386.         for \%j \%i \%n 1 { -
  3387.             xif > \&a[\%i] \&a[\%j] { -
  3388.                 assign \%t \&a[\%i], -
  3389.                 assign \&a[\%i] \&a[\%j], -
  3390.                 assign \&a[\%j] \%t -
  3391.             } -
  3392.         } -
  3393.     }
  3394.  
  3395.     ; Display the sorted array.
  3396.     ;
  3397.     echo sorted.
  3398.     for \%i 1 \%n 1 { echo \flpad(\%i,3). \flpad(\&a[\%i],5) }
  3399.  
  3400.  
  3401. 1.13. The SCRIPT Command
  3402.  
  3403. The SCRIPT command allows connection and login sequences to be specified in a
  3404. single, cryptic line in the style of the Unix uucp L.sys file.
  3405.  
  3406. Syntax: SCRIPT expect send [expect send] . . .
  3407.  
  3408. "expect" has the syntax: expect[-send-expect[-send-expect[...]]]
  3409.  
  3410. The SCRIPT command carries on a "canned dialog" with a remote system, in which
  3411. data is sent according to the remote system's responses.  The typical use is
  3412. for logging in to a remote system automatically.
  3413.  
  3414. A login script is a sequence of the form:
  3415.  
  3416.     expect send [expect send] . . .
  3417.  
  3418. where expect is a prompt or message to be issued by the remote site, and send
  3419. is the string (names, numbers, etc) to return, and expects are separated from
  3420. sends by spaces.  The send may also be the keyword EOT, to send Control-D, or
  3421. BREAK, to send a break signal.  Letters in sends may be prefixed by `~' to send
  3422. special characters, including:
  3423.  
  3424.     ~b  backspace
  3425.     ~s  space
  3426.     ~q  `?'(trapped by Kermit's command interpreter)
  3427.     ~n  linefeed
  3428.     ~r  carriage return
  3429.     ~t  tab
  3430.     ~'  single quote
  3431.     ~-  dash (hyphen)
  3432.     ~~  tilde itself
  3433.     ~"  double quote
  3434.     ~x  XON (Control-Q)
  3435.     ~c  don't append a carriage return
  3436.     ~o[o[o]]  octal representation of an ASCII character code
  3437.     ~d  delay approx 1/3 second during send
  3438.     ~w[d[d]]  wait specified interval during expect, then time out
  3439.     \\b send a BREAK signal
  3440.  
  3441. As with some UUCP systems, sent strings are followed by ~r unless they have a
  3442. ~c.
  3443.  
  3444. Only the last 7 characters in each expect are matched.  A null expect, e.g. ~0
  3445. or two adjacent dashes, causes a short delay before proceeding to the next send
  3446. sequence.  A null expect always succeeds.
  3447.  
  3448. As with UUCP, if the expect string does not arrive, the script attempt fails.
  3449. If you expect that a sequence might not arrive, as with UUCP, conditional
  3450. sequences may be expressed in the form:
  3451.  
  3452.     -send-expect[-send-expect[...]]
  3453.  
  3454. where dashed sequences are followed as long as previous expects fail.  Timeouts
  3455. for expects can be specified using ~w; ~w with no arguments waits 15 seconds.
  3456.  
  3457. expect-send transactions can be easily be debugged by logging transactions.
  3458. This records all exchanges, both expected and actual.  The script execution
  3459. will also be logged in the session log, if that is activated.
  3460.  
  3461. Note that `\' characters in login scripts, as in any other C-Kermit interactive
  3462. commands, must be doubled up.  A line may be ended with a single `\' for
  3463. continuation.
  3464.  
  3465. Example one:
  3466.  
  3467. Using a modem, dial a UNIX host site.  Expect "login" (...gin), and if it
  3468. doesn't come, simply send a null string with a ~r.  (Some Unixes require either
  3469. an EOT or a BREAK instead of the null sequence, depending on the particular
  3470. site's "logger" program.)  After providing user id and password, respond "x" to
  3471. a question-mark prompt, expect the Bourne shell "$" prompt (and send return if
  3472. it doesn't arrive).  Then cd to directory kermit, and run the program called
  3473. "wermit", entering the interactive connect state after wermit is loaded.
  3474.  
  3475.     set modem ventel
  3476.     set line /dev/tty77
  3477.     set baud 1200
  3478.     dial 9&5551212
  3479.     script gin:--gin:--gin: smith ssword: mysecret ~q x $--$ \
  3480.      cd~skermit $ wermit
  3481.     connect
  3482.  
  3483. Note that SET LINE is issued after SET MODEM, but before SET BAUD or other
  3484. line-related parameters.
  3485.  
  3486. Example two:
  3487.  
  3488. Using a modem, dial the Telenet network.  This network expects three returns
  3489. with slight delays between them.  These are sent following null expects.  The
  3490. single return is here sent as a null string, with a return appended by default.
  3491. Four returns are sent to be safe before looking for the prompt.  Then the
  3492. Telenet id and password are entered.  Then Telenet is instructed to connect to
  3493. a host site (c 12345).  The host has a data switch that asks "which system";
  3494. the script responds "myhost" (if the "which system" prompt doesn't appear, the
  3495. Telenet connect command is reissued).  The script waits for an "@" prompt from
  3496. the host, then sends the user ID ("joe") and password ("secret"), looks for
  3497. another "@" prompt, runs Kermit, and in response to the Kermit's prompt (which
  3498. ends in ">"), gives the commands "set parity even" and "server".  Files are
  3499. then exchanged.  The commands are in a take file; note the continuation of the
  3500. 'script' command onto several lines using the `\' terminator.
  3501.  
  3502.     set modem hayes
  3503.     set line /dev/acu
  3504.     set speed 1200
  3505.     set parity mark
  3506.     dial 9,5551212
  3507.     script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 @--@--@ id~s\
  3508.     aa001122 = 002211 @ c~s12345 ystem-c~s12345-ystem \
  3509.     myhost @ joe~ssecret @ kermit > set~sparity~seven > server
  3510.     send some.stuff
  3511.     get some.otherstuff
  3512.     bye
  3513.     quit
  3514.  
  3515. Since these commands may be executed totally in the background, they can also
  3516. be scheduled.  A typical shell script, which might be scheduled by cron, would
  3517. be as follows (csh used for this example):
  3518.  
  3519.     #
  3520.     # Keep trying to dial and log onto remote host and exchange
  3521.     # files, wait 10 minutes before retrying if it fails.
  3522.     #
  3523.     cd someplace
  3524.     while ( 1 )
  3525.         kermit < ./tonight.cmd >> nightly.log &
  3526.         if ( ! $status ) break
  3527.         sleep 600
  3528.     end
  3529.  
  3530. File tonight.cmd might have two takes in it, for example, one to take a file
  3531. with the set modem, set line, set baud, dial, and script, and a second take of
  3532. a file with send/get commands for the remote server.  The last lines of
  3533. tonight.cmd should be BYE and QUIT.
  3534.  
  3535.  
  3536. 1.14. Command Line Operation
  3537.  
  3538. A subset of Kermit's commands is available using Unix-style command line
  3539. options, on operating systems that support passing of command-line options to
  3540. programs through the "argv, argc" mechanism.
  3541.  
  3542. The C-Kermit command line syntax conforms to the Proposed Syntax Standards for
  3543. Unix System Commands put forth by Kathy Hemenway and Helene Armitage of AT&T
  3544. Bell Laboratories in Unix/World, Vol.1, No.3, 1984.  The rules that apply are:
  3545.  
  3546.    - Command names must be between 2 and 9 characters ("kermit" is 6).
  3547.    - Command names must include lower case letters and digits only.
  3548.    - An option name is a single character.
  3549.    - Options are delimited by '-'.
  3550.    - Options with no arguments may be grouped (bundled) behind one
  3551.      delimiter.
  3552.    - Option-arguments cannot be optional.
  3553.    - Arguments immediately follow options, separated by whitespace.
  3554.    - The order of options does not matter.
  3555.    - '-' preceded and followed by whitespace means standard input.
  3556.  
  3557. A group of bundled options may end with an option that has an argument.
  3558.  
  3559. The following notation is used in command descriptions:
  3560.  
  3561.     fn  A file specification, possibly containing the "wildcard" characters `*'
  3562.         or `?' (`*' matches all character strings, `?'  matches any single
  3563.         character).
  3564.  
  3565.  
  3566.     fn1 A Unix file specification which may not contain `*' or `?'.
  3567.  
  3568.  
  3569.     rfn A remote file specification in the remote system's own syntax, which
  3570.         may denote a single file or a group of files.
  3571.  
  3572.  
  3573.     rfn1
  3574.         A remote file specification which should denote only a single file.
  3575.  
  3576.  
  3577.     n   A decimal number between 0 and 94.
  3578.  
  3579.  
  3580.     c   A decimal number between 0 and 127 representing the value of an ASCII
  3581.         character.
  3582.  
  3583.  
  3584.     cc  A decimal number between 0 and 31, or else exactly 127, representing
  3585.         the value of an ASCII control character.
  3586.  
  3587.  
  3588.     [ ] Any field in square braces is optional.
  3589.  
  3590.  
  3591.     {x,y,z}
  3592.         Alternatives are listed in curly braces.
  3593.  
  3594. C-Kermit command line options may specify any combination of actions and
  3595. settings.  If C-Kermit is invoked with a command line that specifies no
  3596. actions, then it will issue a prompt and begin interactive dialog.  Action
  3597. options specify either protocol transactions or terminal connection.
  3598.  
  3599. An implicit TAKE command is executed upon your C-Kermit initialization file
  3600. when C-Kermit starts up, upon either interactive or command-line invocation.
  3601. This file may contain C-Kermit interactive-mode commands, which are explained
  3602. later.
  3603.  
  3604. In addition, if the first command line argument is the name of an existing
  3605. file, C-Kermit will read that file and execute Kermit interactive-mode commands
  3606. from it, in addition to (and after) your initialization file (if any).
  3607. Example:
  3608.  
  3609.     $ kermit cmdfile -b 3 -p m
  3610.  
  3611. In UNIX, this feature allows you to invoke C-Kermit by "running" a C-Kermit
  3612. command file, if its first line is of the form:
  3613.  
  3614.     #!/dir/kermit
  3615.  
  3616. That is, number sign followed by exclamation point, followed by the full file
  3617. specification of the Kermit program.  You must also give this file execute
  3618. permission:
  3619.  
  3620.     $ chmod +x cmdfile
  3621.  
  3622. Then you can run this file as if it were a program, and it will feed itself to
  3623. C-Kermit automatically:
  3624.  
  3625.     $ cmdfile
  3626.  
  3627. You can even include C-Kermit command line options:
  3628.  
  3629.     $ cmdfile -l /dev/ttyh8 -p e
  3630.  
  3631. If you want the shell prompt to return automatically at the end of this file,
  3632. include an EXIT command.  Otherwise you will receive the C-Kermit prompt when
  3633. the file is finished.
  3634.  
  3635. Here are C-Kermit's command-line options:
  3636.  
  3637.     =   Ignore all command-line options that follow (but make them available to
  3638.         the user in the array \&@[]).
  3639.  
  3640.  
  3641.     -Y  (uppercase) Do not execute commands from the initialization file.
  3642.  
  3643.  
  3644.     -y fn
  3645.         Read commands from the specified file instead of the standard
  3646.         initialization file.
  3647.  
  3648.  
  3649.     -s fn
  3650.         Send the specified file or files.  If fn contains wildcard (meta)
  3651.         characters, the Unix shell expands it into a list.  On non-Unix
  3652.         systems, Kermit expands any wildcard characters.  fn may also be a list
  3653.         of files, as in:
  3654.  
  3655.             kermit -s ckcmai.c ckuker.h mail.txt
  3656.  
  3657.         If fn is '-' then kermit sends from standard input, which may come from
  3658.         a file:
  3659.  
  3660.             kermit -s - < foo.bar
  3661.  
  3662.         or a parallel process:
  3663.  
  3664.             ls -l | grep cmg | kermit -s -
  3665.  
  3666.         You cannot use this mechanism to send terminal typein.  If you want to
  3667.         send a file whose actual name is "-" you can precede it with a path
  3668.         name, as in
  3669.  
  3670.             kermit -s ./-
  3671.  
  3672.  
  3673.  
  3674.     -r  Receive a file or files.  Wait passively for files to arrive.
  3675.  
  3676.  
  3677.     -k  Receive (passively) a file or files, sending them to standard output.
  3678.         This option can be used in several ways:
  3679.  
  3680.         kermit -k
  3681.             Displays the incoming files on your screen; to be used only in
  3682.             "local mode" (see below).
  3683.  
  3684.  
  3685.         kermit -k > fn1
  3686.             Sends the incoming file or files to the named file, fn1.  If more
  3687.             than one file arrives, all are concatenated together into the
  3688.             single file fn1.
  3689.  
  3690.  
  3691.         kermit -k | command
  3692.             Pipes the incoming data (single or multiple files) to the indicated
  3693.             command, as in
  3694.  
  3695.                 kermit -k | sort > sorted.stuff
  3696.  
  3697.  
  3698.  
  3699.     -a fn1
  3700.         If you have specified a file transfer option, you may give an alternate
  3701.         name for a single file with the -a ("as") option.  For example,
  3702.  
  3703.             kermit -s foo -a bar
  3704.  
  3705.         sends the file foo telling the receiver that its name is bar.  If more
  3706.         than one file arrives or is sent, only the first file is affected by
  3707.         the -a option:
  3708.  
  3709.             kermit -ra baz
  3710.  
  3711.         stores the first incoming file under the name baz.
  3712.  
  3713.  
  3714.     -x  Begin server operation.  May be used in either local or remote mode.
  3715.  
  3716. Before proceeding, a few words about remote and local operation are necessary.
  3717. C-Kermit is "local" if it is running on PC or workstation that you are using
  3718. directly, or if it is running on a multiuser system and transferring files over
  3719. an external communication line -- not your job's controlling terminal or
  3720. console.  C-Kermit is remote if it is running on a multiuser system and
  3721. transferring files over its own controlling terminal's communication line
  3722. (normally /dev/tty), connected to your PC or workstation.
  3723.  
  3724. If you are running C-Kermit on a PC, it is normally used in local mode, with
  3725. the "back port" designated for file transfer and terminal connection, and the
  3726. keyboard and screen available to control or interrupt the file transfer and to
  3727. display its status.  If you are running C-Kermit on a multiuser (timesharing)
  3728. system, it is in remote mode unless you explicitly point it at an external line
  3729. for file transfer or terminal connection.  The following command determines
  3730. whether C-Kermit is in local or remote mode:
  3731.  
  3732.     -l dev
  3733.         Line -- Specify a terminal line to use for file transfer and terminal
  3734.         connection, as in
  3735.  
  3736.             kermit -l /dev/ttyi5
  3737.  
  3738.         You can also give an open file descriptor for a tty device.  In this
  3739.         case you should also specify the speed:
  3740.  
  3741.             kermit -l 3 -b 2400
  3742.  
  3743. When an external line is being used, you will also need some additional options
  3744. for successful communication with the remote system:
  3745.  
  3746.     -b n
  3747.         Bits per second -- Specify the transmission speed in bits per second
  3748.         ("baud rate") for the line given in the -l option, as in:
  3749.  
  3750.             kermit -l /dev/ttyi5 -b 9600
  3751.  
  3752.         This option should always be included with the -l option, since the
  3753.         speed of an external line is not necessarily what you expect.
  3754.  
  3755.  
  3756.     -p x
  3757.         Parity -- e,o,m,s,n (even, odd, mark, space, or none).  If parity is
  3758.         other than none, then Kermit's 8th-bit prefixing mechanism will be used
  3759.         for transferring 8-bit binary data, provided the opposite Kermit
  3760.         agrees.  The default parity is none.
  3761.  
  3762.  
  3763.     -t  Specifies half duplex, line turnaround with XON as the handshake
  3764.         character.
  3765.  
  3766.  
  3767.     -mname
  3768.         Modem type -- hayes, penril, vadic, etc.  For a complete and up-to-date
  3769.         list, run C-Kermit interactively and type "set modem ?".  Note:  name
  3770.         must be given in lowercase, but can be abbreviated, e.g. "hay" for
  3771.         "hayes".
  3772.  
  3773. If you wish to use a network connection rather than a terminal line for
  3774. communication, use the -j option rather -l:
  3775.  
  3776.     -j name
  3777.         Host -- Specify a network host name.  This option is currently
  3778.         supported for TCP/IP Telnet connections on Berkeley-based UNIX
  3779.         implementations only, and for VAX/VMS when equipped with TGV MultiNet
  3780.         TCP/IP.  The speed (-b) parameter does not apply to network
  3781.         connections.
  3782.  
  3783. The following commands may be used only with a C-Kermit which is in local mode.
  3784.  
  3785.     -g rfn
  3786.         Actively request a remote server to send the named file or files; rfn
  3787.         is a file specification in the remote host's own syntax.  If fn happens
  3788.         to contain any special shell characters, like space, '*', '[', '~',
  3789.         etc, these must be quoted, as in:
  3790.  
  3791.             kermit -g x\*.\?
  3792.  
  3793.         or:
  3794.  
  3795.             kermit -g "profile exec"
  3796.  
  3797.  
  3798.  
  3799.     -f  Send a 'finish' command to a remote server.
  3800.  
  3801.  
  3802.     -c  Establish a terminal connection over the specified or default
  3803.         communication line, before any protocol transaction takes place.  Get
  3804.         back to the local system by typing the escape character (normally
  3805.         Control-Backslash) followed by the letter 'c'.
  3806.  
  3807.  
  3808.     -n  Like -c, but after a protocol transaction takes place; -c and -n may
  3809.         both be used in the same command.  The use of -n and -c is illustrated
  3810.         below.
  3811.  
  3812. If the other Kermit is on a remote system, the -l and -b options should also be
  3813. included with the -r, -k, or -s options.
  3814.  
  3815. Several other command-line options are provided:
  3816.  
  3817.     -i  Specifies that files should be sent or received exactly "as is" with no
  3818.         conversions.  This option is necessary for transmitting binary files.
  3819.         It may also be used in Unix-to-Unix transfers (it must be given to both
  3820.         Unix Kermit programs), where it will improve performance by
  3821.         circumventing the normal text-file conversions, and will allow mixture
  3822.         of text and binary files in a single file group.
  3823.  
  3824.  
  3825.     -w  Writeover -- An incoming file should write over any existing file of
  3826.         the same name.  Changes the default behavior, which is to back up the
  3827.         existing file before creating the new one.
  3828.  
  3829.  
  3830.     -e n
  3831.         Extended packet length -- Specify that C-Kermit is allowed to receive
  3832.         packets up to length n, where n may be between 10 and some large
  3833.         number, like 1000 or 2000, depending on the system.  The default
  3834.         maximum length for received packets is 90.  Packets longer than 94 will
  3835.         be used only if the other Kermit supports, and agrees to use, the "long
  3836.         packet" protocol extension, and if you request them.
  3837.  
  3838.  
  3839.     -v n
  3840.         Window size -- Specify that C-Kermit is allowed to send and receive
  3841.         files using a window size of n.  That is, up to n packets may be sent
  3842.         before acknowledgements are required.  This speeds up transfers in most
  3843.         situations, especially long distance network connections.  Default
  3844.         window size is 1, maximum is 32.  Sizes greater than 1 work only if the
  3845.         other Kermit supports this option.
  3846.  
  3847.  
  3848.     -q  Quiet -- Suppress screen update during file transfer, for instance to
  3849.         allow a file transfer to proceed in the background.
  3850.  
  3851.  
  3852.     -z  Force foreground mode: even if Kermit thinks it is running in the
  3853.         background, this will make it issue its normal prompts and messages.
  3854.         Example:
  3855.  
  3856.             kermit -z | vt100
  3857.  
  3858.  
  3859.  
  3860.     -d  Debug -- Record debugging information in the file debug.log in the
  3861.         current directory.  Use this option if you believe the program is
  3862.         misbehaving, and show the resulting log to your local Kermit
  3863.         maintainer.
  3864.  
  3865.  
  3866.     -h  Help -- Display a brief synopsis of the command line options.
  3867.  
  3868. The command line may contain no more than one protocol action option.
  3869.  
  3870. Files are sent with their own names, except that lowercase letters are raised
  3871. to upper, pathnames are stripped off, certain special characters like (`~') and
  3872. (`#') are changed to `X', and if the file name begins with a period, an `X' is
  3873. inserted before it.  Incoming files are stored under their own names except
  3874. that uppercase letters are lowered, and, if -w was specified, a "generation
  3875. number" is appended to the name if it has the same name as an existing file
  3876. which would otherwise be overwritten.  If the -a option is included, then the
  3877. same rules apply to its argument.  The file transfer display shows any
  3878. transformations performed upon filenames.
  3879.  
  3880. During transmission, files are encoded as follows:
  3881.  
  3882.    - Control characters are converted to prefixed printables.
  3883.  
  3884.    - Sequences of repeated characters are collapsed via repeat counts, if
  3885.      the other Kermit is also capable of repeated-character compression.
  3886.      This feature is negotiated automatically.
  3887.  
  3888.    - If parity is being used on the communication line, data characters
  3889.      with the 8th (parity) bit on are specially prefixed, provided the
  3890.      other Kermit is capable of 8th-bit prefixing; if not, 8-bit binary
  3891.      files cannot be successfully transferred.  This feature is negotiated
  3892.      if you give the -p option.
  3893.  
  3894.    - Conversion is done between Unix newlines and carriage-return-linefeed
  3895.      sequences unless the -i option was specified.
  3896.  
  3897.  
  3898. Command Line Examples:
  3899.  
  3900.  
  3901.     kermit -l /dev/ttyi5 -b 1200 -cn -r
  3902.  
  3903. This command connects you to the system on the other end of ttyi5 at 1200 baud,
  3904. where you presumably log in and run Kermit with a SEND command.  After you
  3905. escape back, C-Kermit waits for a file (or files) to arrive.  When the file
  3906. transfer is completed, you are reconnected to the remote system so that you can
  3907. logout.
  3908.  
  3909.  
  3910.     kermit -l /dev/ttyi4 -b 1800 -cntp m -r -a foo
  3911.  
  3912. This command is like the preceding one, except the remote system in this case
  3913. uses half duplex communication with mark parity.  The first file that arrives
  3914. is stored under the name foo.
  3915.  
  3916.  
  3917.     kermit -l /dev/ttyi6 -b 9600 -c | tek
  3918.  
  3919. This example uses Kermit to connect your terminal to the system at the other
  3920. end of ttyi6.  The C-Kermit terminal connection does not provide any particular
  3921. terminal emulation, so C-Kermit's standard i/o is piped through a
  3922. (hypothetical) program called tek, which performs (say) Tektronix emulation.
  3923.  
  3924.  
  3925.     kermit -l /dev/ttyi6 -b 9600 -nf
  3926.  
  3927. This command would be used to shut down a remote server and then connect to the
  3928. remote system, in order to log out or to make further use of it.  The -n option
  3929. is invoked after -f (-c would have been invoked before).
  3930.  
  3931.  
  3932.     kermit -l /dev/ttyi6 -b 9600 -qg foo.\* &
  3933.  
  3934. This command causes C-Kermit to be invoked in the background, getting a group
  3935. of files from a remote server (note the quoting of the `*' character).  No
  3936. display occurs on the screen, and the keyboard is not sampled for interruption
  3937. commands.  This allows other work to be done while file transfers proceed in
  3938. the background.  UNIX only.
  3939.  
  3940.  
  3941.     kermit -l /dev/ttyi6 -b 9600 -g foo.\* > foo.log < /dev/null &
  3942.  
  3943. This command is like the previous one, except the file transfer display has
  3944. been redirected to the file foo.log.  Standard input is also redirected, to
  3945. prevent C-Kermit from sampling it for interruption commands.
  3946.  
  3947.  
  3948.     kermit -iwx
  3949.  
  3950. This command starts up C-Kermit as a server.  Files are transmitted with no
  3951. newline/carriage-return-linefeed conversion; the -i option is necessary for
  3952. binary file transfer and recommended for Unix-to-Unix transfers.  Incoming
  3953. files that have the same names as existing files are given new, unique names.
  3954.  
  3955.  
  3956.     kermit -l /dev/ttyi6 -b 9600
  3957.  
  3958. This command sets the communication line and speed.  Since no action is
  3959. specified, C-Kermit issues a prompt and enters an interactive dialog with you.
  3960. Any settings given on the command line remain in force during the dialog,
  3961. unless explicitly changed.
  3962.  
  3963.  
  3964.     kermit
  3965.  
  3966. This command starts up Kermit interactively with all default settings.
  3967.  
  3968. The next example shows how Unix Kermit might be used to send an entire
  3969. directory tree from one Unix system to another, using the tar program as
  3970. Kermit's standard input and output.  On the originating system, in this case
  3971. the remote, type (for instance):
  3972.  
  3973.  
  3974.     tar cf - /usr/fdc | kermit -is -
  3975.  
  3976. This causes tar to send the directory /usr/fdc (and all its files and all its
  3977. subdirectories and all their files...) to standard output instead of to a tape;
  3978. kermit receives this as standard input and sends it as a binary file.  On the
  3979. receiving system, in this case the local one, type (for instance):
  3980.  
  3981.  
  3982.     kermit -il /dev/ttyi5 -b 9600 -k | tar xf -
  3983.  
  3984. Kermit receives the tar archive, and sends it via standard output to its own
  3985. copy of tar, which extracts from it a replica of the original directory tree.
  3986.  
  3987. A final example shows how a Unix compression utility might be used to speed up
  3988. Kermit file transfers:
  3989.  
  3990.     compress file | kermit -is -     (sender)
  3991.     kermit -ik | uncompress          (receiver)
  3992.  
  3993.  
  3994. 1.15. UNIX Specifics
  3995.  
  3996.  
  3997. 1.15.1. The Unix File System
  3998.  
  3999. Consult your Unix manual for details about the file system under your version
  4000. of Unix.  In general, Unix files have lowercase names, possibly containing one
  4001. or more dots or other special characters.  Unix directories are tree-
  4002. structured.  Directory levels are separated by slash ("/") characters.  For
  4003. example,
  4004.  
  4005.     /usr/foo/bar
  4006.  
  4007. denotes the file bar in the directory /usr/foo.  Alphabetic case is significant
  4008. in Unix file and directory names, i.e. "a" is a different file (or directory)
  4009. from "A".  Wildcard or "meta" characters allow groups of files to be specified.
  4010. "*" matches any string; "?" matches any single character.
  4011.  
  4012. When C-Kermit is invoked with file arguments specified on the Unix command
  4013. line, the Unix shell (Bourne Shell, C-Shell, K-Shell, etc) expands the meta
  4014. characters itself, and in this case a wider variety is available.  For example,
  4015.  
  4016.     kermit -s ~/ck[uvm]*.{upd,bwr}]
  4017.  
  4018. is expanded by the Berkeley C-Shell into a list of all the files in the user's
  4019. home directory (~/) that start with the characters "ck", followed by a single
  4020. character "u", "v", or "m", followed by zero or more characters, followed by a
  4021. dot, followed by one of the strings "upd" or "bwr".  Internally, the C-Kermit
  4022. program itself expands only the "*" and "?" meta characters.
  4023.  
  4024. Unix files are linear (sequential) streams of 8-bit bytes.  Text files consist
  4025. of 7-bit ASCII or ISO-646 NRC characters, with the high-order bit off (0), or
  4026. in very recent versions of Unix, of 8-bit characters in an ASCII-based
  4027. international standard character set such as ISO 8859 Latin Alphabet 1.  Text
  4028. file lines are separated by the Unix newline character, which is linefeed (LF,
  4029. ASCII 10).  This distinguishes Unix text files from those on most other
  4030. ASCII-based stream file systems, in which lines are separated by a carriage-
  4031. return linefeed sequence (CRLF, ASCII 13, followed by linefeed, ASCII 10).
  4032. Binary files are likely to contain data in the high bits of the file bytes, and
  4033. have no particular line or record structure.
  4034.  
  4035.  
  4036. 1.15.2. UUCP Lock Files
  4037.  
  4038. Unix has no built-in way of obtaining exclusive access to an external
  4039. communication line.  When you issue the 'set line' command to Unix Kermit, Unix
  4040. would normally grant you access to the line even if some other process is
  4041. making use of it.  The method adopted by most Unix systems to handle this
  4042. situation is the "UUCP lock file".  UUCP, the Unix-to-Unix Copy program,
  4043. creates a file in its directory (usually /usr/spool/uucp, but often elsewhere)
  4044. with a name like LCK..name, where name is the device name, for instance
  4045. LCK..tty07.
  4046.  
  4047. Unix Kermit uses UUCP lock files in order to avoid conflicts with UUCP, tip, or
  4048. other programs that follow this convention, including other users running
  4049. Kermit itself.  Whenever you attempt to access an external line using the 'set
  4050. line' command or `-l' on the command line, Kermit looks in the UUCP directory
  4051. for a lock file corresponding to that device.  For instance, if you 'set line
  4052. /dev/ttyi6' then Kermit looks for the file
  4053.  
  4054.     /usr/spool/uucp/LCK..ttyi6
  4055.  
  4056. If it finds this file, it gives you an error message and a directory listing of
  4057. the file so that you can see who is using it, e.g.
  4058.  
  4059.     -r--r--r--  1 fdc    8 Feb  7 13:02 /usr/spool/uucp/LCK..ttyi6
  4060.  
  4061. In this case, you would look up user fdc to find out how soon the line will
  4062. become free.
  4063.  
  4064. This convention requires that the uucp directory be publicly readable and
  4065. writable.  If it is not, the program will issue an appropriate warning message.
  4066.  
  4067. If no lock file is found, Unix Kermit will attempt create one, thus preventing
  4068. anyone who subsequently tries to run Kermit, UUCP, cu, tip, or similar programs
  4069. on the same line from gaining access until you release the line.  If Kermit
  4070. could not create the lock file (for instance because the uucp directory is
  4071. write-protected), then you will receive an error message.
  4072.  
  4073. Even when the lock directory is writable and readable, the locking mechanism
  4074. depends upon all users using the same name for the same device.  If a device
  4075. has more than one path associated with it, then a lock can be circumvented by
  4076. using an alias.
  4077.  
  4078. When a lock-creating program abruptly terminates, e.g. because it crashes or is
  4079. killed via shell command, the lock file remains in the uucp directory,
  4080. spuriously indicating that the line is in use.  If the lock file is owned by
  4081. yourself, you may remove it.  Otherwise, you'll have to get the owner or the
  4082. system manager to remove it, or else wait for a system task to do so; uucp
  4083. supports a function (uuclean) which removes these files after a predetermined
  4084. age -- uucp sites tend to run this function periodically via crontab.
  4085.  
  4086. Locking is not needed, or used, if communications occur over the user's login
  4087. terminal line (normally /dev/tty).
  4088.  
  4089.  
  4090. 1.15.3. C-Kermit under Berkeley or System III/V Unix
  4091.  
  4092. C-Kermit may be interrupted at command level or during file transfer by typing
  4093. Control-C.  The program will perform its normal exit function, restoring the
  4094. terminal and releasing any lock.  If a protocol transaction was in progress, an
  4095. error packet will be sent to the opposite Kermit so that it can terminate
  4096. cleanly.
  4097.  
  4098. C-Kermit may be invoked in the background ("&" on shell commmand line).  If a
  4099. background process is "killed", the user will have to manually remove any lock
  4100. file and may need to restore the modem.  This is because the kill signal
  4101. (kill(x,9)) cannot be trapped by Kermit.
  4102.  
  4103. During execution of a system command ('directory', 'cd', or `!'), C-Kermit can
  4104. often be returned to command level by typing a single Control-C.  (With System
  4105. III/V, the usual interrupt function (often the DEL key) is replaced by
  4106. Control-C.)
  4107.  
  4108. Under Berkeley Unix only: C-Kermit may also be interrupted by ^Z to put the
  4109. process in the background.
  4110.  
  4111. Control-C, Control-Z, and Control-\ lose their normal functions during terminal
  4112. connection and also during file transfer when the controlling tty line is being
  4113. used for packet i/o.
  4114.  
  4115. If you are running C-Kermit in "quiet mode" in the foreground, then
  4116. interrupting the program with a console interrupt like Control-C will not
  4117. restore the terminal to normal conversational operation.  This is because the
  4118. system call to enable console interrupt traps will cause the program to block
  4119. if it's running in the background, and the primary reason for quiet mode is to
  4120. allow the program to run in the background without blocking, so that you can do
  4121. other work in the foreground.
  4122.  
  4123. If C-Kermit is run in the background ("&" on shell commmand line), then the
  4124. interrupt signal (Control-C) (and System III/V quit signal) are ignored.  This
  4125. prevents an interrupt signal intended for a foreground job (say a compilation)
  4126. from being trapped by a background Kermit session.
  4127.  
  4128.  
  4129. 1.15.4. C-Kermit on the AT&T UNIX PC
  4130.  
  4131. For Unix PC owners here are a couple of hints.  The name of the phone line
  4132. devices are /dev/ph0 and /dev/ph1. The RS232 serial port is /dev/tty000.
  4133.  
  4134. Dialing out with the internal modem:
  4135.  
  4136.     C-Kermit>set line /dev/ph0
  4137.     C-Kermit>set speed 1200
  4138.     C-Kermit>set modem att7300
  4139.     C-Kermit>dial (123) 555-1212
  4140.  
  4141. Or use /dev/ph1 for the second phone line.  Control-C will terminate the
  4142. dialer.  The telephone line must be in the DATA state; C-Kermit will remind you
  4143. of this if it finds the line in VOICE state.
  4144.  
  4145. Connecting via the RS232C serial port:
  4146.  
  4147.     $ kermit
  4148.     C-Kermit>set line /dev/tty000
  4149.     C-Kermit>set speed 9600
  4150.         (start doing work...)
  4151.         (after exiting C-Kermit you may type:)
  4152.  
  4153. C-Kermit automatically handles disabling and enabling logins on the phone lines
  4154. and RS-232 port.
  4155.  
  4156.  
  4157. 1.16. X.25 Support
  4158.  
  4159. This section applies only to UNIX C-Kermit on SUN computers that are attached
  4160. to X.25 networks via the SunLink X.25 product.
  4161.  
  4162. To use an X.25 connection:
  4163.  
  4164.     C-Kermit>set network x.25
  4165.     C-Kermit>set host aaaaaaa
  4166.     C-Kermit>connect
  4167.  
  4168. where aaaaaaa is the X.121 address of the host you wish to connect to.  An
  4169. X.121 address is a many-digit number consisting of a 4-digit DNIC (Data Network
  4170. Identification Code) followed by an NTN (Network Terminal Number) up to 10
  4171. digits in length, or a 3-digit DCC (Data Country Code) followed by a
  4172. country-dependent NN (National Number) up to 11 digits in length.
  4173.  
  4174. The following connect-mode escapes apply to X.25 terminal connections:
  4175.  
  4176. Ctrl-\H
  4177.     Hangup - Close the X.25 network connection.
  4178.  
  4179.  
  4180. Ctrl-\I
  4181.     Interrupt - Send an X.25 interrupt packet.
  4182.  
  4183.  
  4184. Ctrl-\R
  4185.     Reset the X.25 virtual circuit.
  4186.  
  4187. The following special commands can be used to control your X.25 connection:
  4188.  
  4189. HANGUP
  4190.     Close the X.25 network connection.
  4191.  
  4192.  
  4193. PAD CLEAR
  4194.     Clear the X.25 virtual circuit.
  4195.  
  4196.  
  4197. PAD INTERRUPT
  4198.     Send an X.25 Interrupt packet.
  4199.  
  4200.  
  4201. PAD RESET
  4202.     Reset the X.25 virtual circuit.
  4203.  
  4204.  
  4205. PAD STATUS
  4206.     X.25 status request.
  4207.  
  4208.  
  4209. SET PAD BREAK-ACTION n
  4210.     X.3 Parameter 7.  What PAD should do if it receives a BREAK signal.  0 =
  4211.     nothing, 1 = send Interrupt packet, 2 = reset, 4 = send Indication Of Break
  4212.     PAD message, 8 = escape to PAD, 16 = discard output.  Default = 21 (= 16 +
  4213.     4 + 1).
  4214.  
  4215.  
  4216. SET PAD BREAK-CHARACTER n
  4217.     Default 0.
  4218.  
  4219.  
  4220. SET PAD LINE-DELETE n
  4221.     X.3 Parameter 17.  0-127 = ASCII value of character to be used for erasing
  4222.     a line.  Default = 21 (Ctrl-U).
  4223.  
  4224.  
  4225. SET PAD CHARACTER-DELETE n
  4226.     X.3 Parameter 16.  0-127 = ASCII value of character to be used for erasing
  4227.     a character.  Default = 8 (Ctrl-H = Backspace).
  4228.  
  4229.  
  4230. SET PAD CR-PADDING n
  4231.     X.3 Parameter 9, Padding After Carriage Return (CR).  0-255.  Number of
  4232.     padding characters PAD should send to DTE after sending a CR.  Default = 0.
  4233.  
  4234.  
  4235. SET PAD DISCARD-OUTPUT { 0, 1 }
  4236.     X.3 Parameter 8.  0 = normal data delivery, 1 = discard output.  Default =
  4237.     0.
  4238.  
  4239.  
  4240. SET PAD LINE-DISPLAY n
  4241.     X.3 Parameter 18.  0-127 = ASCII value of character to redisplay an edited
  4242.     line.  Default = 18 (Ctrl-R).
  4243.  
  4244.  
  4245. SET PAD ECHO { 0, 1 }
  4246.     X.3 Parameter 2.  0 = PAD will not echo, 1 = PAD will echo.  Default = 1.
  4247.  
  4248.  
  4249. SET PAD EDITING { 0, 1 }
  4250.     X.3 Parameter 15.  0 = No editing, 1 = editing allowed.  Default = 1.
  4251.  
  4252.  
  4253. SET PAD ESCAPE { 0, 1 }
  4254.     X.3 Parameter 1.  0 = Escape to PAD not possible, 1 = Ctrl-P escapes to
  4255.     PAD.
  4256.  
  4257.  
  4258. SET PAD FORWARD n
  4259.     X.3 Parameter 3, Data Forwarding Characters.  0 = none, 1 = any
  4260.     alphanumeric, 2 = carriage return, etc.  Default = 2.
  4261.  
  4262.  
  4263. SET PAD LF-PADDING n
  4264.     X.3 Parameter 14. 0-255 padding characters to be sent by PAD after
  4265.     linefeed.  Default = 0.
  4266.  
  4267.  
  4268. SET PAD LF-INSERT n
  4269.     X.3 Parameter 13, Linefeed (LF) insertion after carriage return (CR).  0 =
  4270.     no LF insertion, 1 = PAD inserts LF after each CR sent to DTE, 2 = PAD
  4271.     inserts LF after each CR received from DTE, 4 = PAD echoes LF as CRLF.
  4272.     Default = 0.
  4273.  
  4274.  
  4275. SET PAD LINE-FOLD n
  4276.     X.3 Parameter 10, Line Folding.  0 = none, 1-255 = number of graphic
  4277.     characters per line after which to insert folding characters.  Default = 0.
  4278.  
  4279.  
  4280. SET PAD PAD-FLOW-CONTROL { 0, 1 }
  4281.     X.3 Parameter 5.  0 = No flow control by PAD, 1 = PAD may send Xon/Xoff
  4282.     flow control to user.  Default = 0.
  4283.  
  4284.  
  4285. SET PAD SERVICE-SIGNALS { 0, 1 }
  4286.     X.3 parameter 6, PAD Service and Command Signals.  0 = PAD service signals
  4287.     are not sent to DTE, 1 = PAD service signals sent.  Default = 1.
  4288.  
  4289.  
  4290. SET PAD TIMEOUT n
  4291.     X.3 Parameter 4, Data forwarding timeout, 0-255 (twentieths of a second).
  4292.     Default = 0 (no data forwarding on timeout).
  4293.  
  4294.  
  4295.  
  4296.  
  4297. SET PAD USER-FLOW-CONTROL { 0, 1 }
  4298.     X.3 Parameter 12.  0 = no flow control by user, 1 = user device may send
  4299.     Xon/Xoff flow control to PAD.  Default = 0.
  4300.  
  4301.  
  4302. SET X.25 CALL-USER-DATA { ON [ text ], OFF }
  4303.     OFF = no call user data, ON text sends the given text during call setup.
  4304.  
  4305.  
  4306. SET X.25 CLOSED-USER-GROUP { OFF, ON n }
  4307.     OFF = no closed user group, ON n specifies the user group number, 0 to 99.
  4308.     OFF by default.
  4309.  
  4310.  
  4311. SET X.25 REVERSE-CHARGE { OFF, ON }
  4312.     OFF = caller pays, ON = callee pays.  Default is OFF.
  4313.  
  4314.  
  4315. 1.17. C-Kermit under VAX/VMS
  4316.  
  4317. This section contributed by Terry Kennedy, St. Peter's College, Jersey City,
  4318. NJ, USA.
  4319.  
  4320.  
  4321. 1.17.1. File Transfer Issues
  4322.  
  4323. VMS provides a plethora of file formats, most of which have no direct
  4324. equivalent on other operating systems (especially the other operating systems
  4325. that C-Kermit runs under).  Thus, the user is faced with the issue of file
  4326. format conversion.  VMS C-Kermit attempts to make this as painless as possible
  4327. by mapping the various file formats to canonical form on transmission, and by
  4328. creating the simplest file structure upon reception.  Various C-Kermit commands
  4329. may be used to give C-Kermit "hints" about what the user desires.  Some of
  4330. these work only when sending files, others only when receiving files.  First,
  4331. let's discuss some terms:
  4332.  
  4333. BINARY TRANSFER MODE (SET FILE TYPE BINARY)
  4334.  
  4335. When sending a file, C-Kermit/VMS reads bytes from the file and sends them
  4336. without any kind of interpretation, translation, or reformatting.  In
  4337. particular, no characters are inserted at record boundaries.
  4338.  
  4339. When receiving files, C-Kermit/VMS collects bytes and writes them to disk at
  4340. intervals.  The file is created as "Fixed" organization, with the record size
  4341. specifed by the user with SET FILE RECORD-LENGTH, or the default value of 512
  4342. if the user does not override it.  For both send and receive operations, the
  4343. RMS attribute "First free byte" is used.  Thus, VMS C-Kermit can operate on
  4344. files where the file size (in bytes) is not an exact multiple of the file
  4345. record size.
  4346.  
  4347. TEXT TRANSFER MODE (SET FILE TYPE TEXT)
  4348.  
  4349. When sending files, C-Kermit/VMS attempts to convert the file to a form which
  4350. has the proper delimiters for "canonical Kermit protocol" form.  Specifically,
  4351. CR and LF characters are inserted as needed at the end of each record.  This is
  4352. normally an easy task, but is complicated by some VMS file types (such as the
  4353. "Fortran carriage control" type).  On reception, files are created as
  4354. "Sequential variable, carriage return carriage control".  C-Kermit uses a CR
  4355. followed immediately by a LF as a record delimiter.  Lone CR's or LF's are
  4356. written as part of a record if they are present.
  4357.  
  4358. LABELED TRANSFER MODE (SET FILE TYPE LABELED)
  4359.  
  4360. When in this mode, C-Kermit/VMS gathers information about the file from various
  4361. sources, such as the file's directory entry, ACL's, etc. and transmits it as
  4362. part of the file data. This is called a LABELED FILE. Such files are not usable
  4363. on non-VMS systems, but may be stored on such systems and later restored to
  4364. another (or the same) VAX. An external utility named CKVCVT reconstitutes the
  4365. file as it was, with various options.
  4366.  
  4367. Other systems should treat labeled files as simple files of TYPE BINARY.
  4368.  
  4369. Now, let's discuss the actions of sending or receiving:
  4370.  
  4371.  
  4372. 1.17.1.1. Sending Files from VMS C-Kermit
  4373.  
  4374. The requested file is opened and the VMS file characteristics are examined.
  4375. Files of format "Undefined" or "Fixed" are sent as binary files, other formats
  4376. are sent as text files.
  4377.  
  4378. SET FILE TYPE IMAGE.  This forces the file to be sent as a stream of bytes,
  4379. regardless of file characteristics, with a file type of binary declared in the
  4380. attribute packet.  This is useful for cases where other applications generate
  4381. file contents with inappropriate file characteristics (for example, a stream-LF
  4382. file which is actually binary data).  This should only be used as a last
  4383. resort, as [normally] RMS inserts bytes in the file for control purposes, and
  4384. these bytes are transmitted (and misinterpreted by the receiving system).
  4385.  
  4386. SET FILE TYPE LABELED forces the file to be sent in labeled format, with
  4387. C-Kermit reading the file from the disk as in IMAGE mode, and with a file type
  4388. of binary declared in the attribute packet.
  4389.  
  4390.  
  4391. 1.17.1.2. Receiving Files to VMS C-Kermit
  4392.  
  4393. The characteristics supplied in the file's attribute packet are used to
  4394. determine the desired file type.  If no attribute packet arrives, the current
  4395. SET FILE TYPE setting, TEXT or BINARY, is used.  If the current file type is
  4396. IMAGE, BINARY is used.  SET FILE TYPE UNDEFINED forces the received file to be
  4397. written with RMS RECORD FORMAT UNDEFINED for compatbility with some software
  4398. that uses non-RMS routines for manipulating files.  This option should normally
  4399. not be used, as you will generate files VMS can't do anything with.
  4400.  
  4401. If the current FILE TYPE is LABELED, the incoming file is handled in LABELED
  4402. mode if (a) its attribute packet declares its type to be binary, OR (b) there
  4403. is no attribute packet.  If the attribute packet says the file type is text,
  4404. C-Kermit rejects the file. At the present time, C-Kermit does not understand
  4405. received labeled files, and you should use the external CKVCVT utility to
  4406. convert them.
  4407.  
  4408.  
  4409. 1.17.2. PRACTICAL APPLICATIONS
  4410.  
  4411.  
  4412. 1.17.2.1. Between a VMS System and a Different System
  4413.  
  4414. The defaults should function properly, provided that the receiving system uses
  4415. the "stream-of-bytes" philosophy of Unix.  Extensive testing has been done
  4416. between VMS C-Kermit and Unix C-Kermit, as well as MS-DOS Kermit.  Other
  4417. systems may require a re-thinking of the transfer strategy, but this author
  4418. [tmk] considers it unlikely.
  4419.  
  4420.  
  4421. 1.17.2.2. Between VMS Systems
  4422.  
  4423. The goal of the defaults is to produce useful output in the majority of cases.
  4424. If you need to transfer binary files where record boundaries are important and
  4425. don't occur at fixed intervals (such as .OBJ files), or where the file
  4426. semantics are extensive and not propagated by C-Kermit (such as DDIF files,
  4427. indexed files, or files with extended semantics stored in an ACE, such as PCSA
  4428. file service contents), you have two options.
  4429.  
  4430.    1. SET FILE TYPE LABELED.  Give this command to the sending C-Kermit
  4431.       system, receive the file on the target VMS system, and extract the
  4432.       contents with CKVCVT.
  4433.  
  4434.    2. Encapsulate these files using VMS BACKUP, transfer the BACKUP
  4435.       saveset, and then restore it on the target system.  BACKUP produces
  4436.       output files with a simple fixed length record structure.  You
  4437.       should specify an explicit record size on the BACKUP command line
  4438.       such as:
  4439.  
  4440.           BACKUP *.* FILES.BCK/SAVE_SET/RECORD=8192
  4441.  
  4442.       and give the record size to the receiving Kermit with the command
  4443.       SET FILE RECORD-LENGTH before sending your saveset.
  4444.  
  4445.  
  4446. 1.17.3. Compatibility with Bliss-32 Kermit
  4447.  
  4448. Testing has shown that the two Kermits make similar assumptions about file
  4449. characteristics.  A variety of files were uploaded from MS-DOS to VMS with
  4450. Bliss-32 Kermit, using a variety of transfer modes, and then returned to MS-DOS
  4451. with C-Kermit and a byte-for-byte comparison was performed.  The reverse
  4452. operation was then tried and tested.  No discrepancies were found.  Although
  4453. this does not guarantee 100% compatibility, it is very close.  Equivalences:
  4454.  
  4455. C-Kermit/VMS                  Bliss Kermit-32
  4456.  
  4457. SET FILE TYPE TEXT            SET FILE TYPE ASCII
  4458. SET FILE TYPE BINARY [FIXED]  SET FILE TYPE BINARY, SET FILE TYPE FIXED
  4459. SET FILE TYPE BIN UNDEF       (none)
  4460. SET FILE TYPE IMAGE           SET FILE TYPE BLOCK
  4461. SET FILE TYPE LABELED         (none)
  4462.  
  4463. Note: There is no distinction between SET FILE TYPE BINARY and FIXED in
  4464. C-Kermit/VMS, and none is needed.  C-Kermit determines the file type and length
  4465. automatically when sending, and when receiving binary files, creates a
  4466. fixed-format file and marks the true end using the "first free byte" mechanism
  4467. of RMS.  EXCEPT if you have given the command SET FILE TYPE BINARY UNDEFINED,
  4468. in which case the file is stored with the RMS record format of UNDEFINED rather
  4469. than fixed (but in the same format as a fixed file).
  4470.  
  4471.  
  4472. 1.17.4. Date and Time Attributes
  4473.  
  4474. The VMS C-Kermit server sends the file's creation date in the attribute packet
  4475. when a file is sent.  When receiving files, if there was valid date/time
  4476. information in the attribute packet, C-Kermit will set the new file's creation
  4477. date/time to the value provided.  The file will be marked as being revised once
  4478. (initial creation), on the current date/time.  This is necessary to ensure that
  4479. the file will be detected as "new" by VMS BACKUP.  You should also note that if
  4480. a file with a creation date in the future (as perceived by VMS) is received
  4481. from a remote Kermit, the system will report "File has creation date in the
  4482. future" to your system management if they use the ANALYZE/DISK command before
  4483. the file's creation date has occured.
  4484.  
  4485. VMS C-Kermit has the command SET FILE COLLISION UPDATE, which can be used to
  4486. reject files when there is a newer file than the incoming one with the same
  4487. name.  If you use this option, be aware that due to system clock skew, you may
  4488. be able to send the file several times in succession before VMS C-kermit
  4489. rejects it as [now] being older than the one on the VAX.
  4490.  
  4491.  
  4492. 1.17.5. File Size Attributes
  4493.  
  4494. When sending files, VMS C-Kermit fills in the file size information in the
  4495. attribute packet. Note that the reported sizes may differ from the actual size
  4496. due to insertion of CR/LF characters on transmission.
  4497.  
  4498. For received files, VMS C-Kermit checks checks for sufficient free disk space
  4499. if the remote Kermit supplies file size information. If there isn't enough
  4500. space on the disk, VMS C-Kermit will reject the file. Please note that user
  4501. quotas are not checked. The logic to do so is quite complicated, and would lead
  4502. to VMS C-Kermit rejecting files that could be received. As an example, consider
  4503. a user with EXQUOTA privilege. In general, a file size rejection by VMS
  4504. C-Kermit means the file will not fit; the lack of a rejection does not
  4505. guarantee that the file will fit. Consider a small file being received onto an
  4506. RX50 floppy. If debugging is turned on, the debug output will fill the floppy
  4507. before the file is completely received.
  4508.  
  4509. If the device for the received file is not a disk (for example, the system
  4510. lineprinter) the file is assumed to always fit.
  4511.  
  4512.  
  4513. 1.17.6. SET FILE TYPE LABELED
  4514.  
  4515. Labeled files contain various pieces of information needed to reconstruct the
  4516. file. At the moment, this is handled by an external utility known as CKVCVT.
  4517. Some items are always restored and other are not restored unless the user
  4518. explicitly asks for them. File characteristics are always restored.  The file
  4519. name is restored (de-truncated). However, the complete directory specification
  4520. is not used to recreate the file unless explicitly requested.  This means that
  4521. converted files will normally be restored to your current directory. Similarly,
  4522. file ownership is assigned to you unless you specify that the original owner be
  4523. retained. Note that the two previous options will require privileges. The file
  4524. backup date is normally cleared so that the file will be backed up. This action
  4525. may be overridden.
  4526.  
  4527. File ACE's are normally not restored. This is an all-or-nothing operation, as
  4528. there are many types of ACE's under VMS. The most common usage of an ACE is to
  4529. grant/deny file access to other users. However, various other uses exist. Some
  4530. examples are: RMS Journaling, RMS Statistics, DDIF, and Pathworks.  Note that
  4531. ACE's are transported in binary mode, which means that protection ACE's may
  4532. wind up applying to incorrect users if you move files between different VMS
  4533. systems with ACE's enabled. Also, note that you can create ACE's which you
  4534. cannot see with DIR/FULL unless you have SECURITY privilege.  However, you
  4535. should be able to view (but not modify) them with EDIT/ACL. This also means
  4536. that you will not be able to delete these ACE's without deleting the file,
  4537. which is another reason they are normally not restored.
  4538.  
  4539. RMS Journaling files are a special case. Journaling will not be enabled for a
  4540. received labeled file. A DIR/FULL will show the journaling ACE, which you can
  4541. use to determine the correct journaling paramters if you wish to journal the
  4542. new file. Note that if you restore the file to another disk (even if it is on
  4543. the same system) the journaling information will display incorrectly.  This is
  4544. a limit of the DEC RMS Journaling product.
  4545.  
  4546.  
  4547. 1.17.7. Reporting Problems
  4548.  
  4549. If you have a file that does not transfer correctly, or that exhibits a problem
  4550. when moved one way with Bliss-32 Kermit and the back with C-Kermit, we would be
  4551. interested in seeing it (especially if it's small 8-).  Please make a BACKUP
  4552. saveset of it under VMS, and send the saveset along to the BUGS address (use
  4553. the command BUG in C-Kermit for up-to-date information).  Please include any
  4554. specific information you think would be useful.  As a bare minimum, please give
  4555. the Kermit version number(s), the VMS version, and the compiler version (if you
  4556. re-compiled Kermit).
  4557.  
  4558.  
  4559. 1.17.8. Sections that need to be added
  4560.  
  4561. Hints for users and system managers on configuring their VMS system and
  4562. terminal devices for best use with Kermit -- BYTLM quotas, Alt-typahead
  4563. buffers, etc etc.  What are the sysgen options, what SET TERMINAL commands (if
  4564. any) should be used before running C-Kermit, etc...
  4565.